/* ============================================================
   HAPPY RAN EP4 - ADMIN V3 GLOBAL REDESIGN
   Visual-only global admin theme.
   Designed to work on the current admin sidebar + existing admin views.
   ============================================================ */

:root {
    --av3-bg: #04090d;
    --av3-bg2: #07111a;
    --av3-panel: rgba(7, 18, 27, .96);
    --av3-panel2: rgba(9, 22, 32, .96);
    --av3-line: #294052;
    --av3-line-soft: rgba(67, 92, 111, .32);
    --av3-red: #d12833;
    --av3-red2: #7d151b;
    --av3-gold: #c79338;
    --av3-gold2: #efc565;
    --av3-blue: #5aaef0;
    --av3-green: #45df92;
    --av3-text: #f1ede6;
    --av3-muted: #7890a3;
}

/* ------------------------------------------------------------
   ADMIN PAGE DETECTION
   ------------------------------------------------------------ */

body:has(.admin-page),
body:has(.admin-item-page),
body:has(.admin-player-page),
body:has(.admin-news-page),
body:has(.admin-webmall-page),
body:has(.admin-notification-page),
body:has(.admin-point-page),
body:has(.admin-daily-login-page),
body:has(.admin-event-page),
body:has(.admin-transaction-page) {
    background:
        linear-gradient(rgba(2,7,11,.91), rgba(2,7,11,.97)),
        url('/images/admin-v3/admin-bg.png') center top / cover fixed no-repeat,
        #04090d !important;
    color: var(--av3-text) !important;
}

/* Hide normal public footer only on admin pages if current shell still renders it */
body:has(.admin-page) > .footer,
body:has(.admin-item-page) > .footer,
body:has(.admin-player-page) > .footer,
body:has(.admin-news-page) > .footer,
body:has(.admin-webmall-page) > .footer,
body:has(.admin-notification-page) > .footer,
body:has(.admin-point-page) > .footer {
    display: none !important;
}

/* ------------------------------------------------------------
   CURRENT ADMIN SHELL / SIDEBAR
   Supports likely shell classes without requiring HTML changes.
   ------------------------------------------------------------ */

.admin-shell,
.admin-layout,
.admin-wrapper,
.admin-app {
    background: transparent !important;
}

.admin-sidebar,
.admin-side,
.admin-nav-sidebar,
aside.admin-nav {
    background:
        linear-gradient(180deg, rgba(5,14,22,.99), rgba(4,11,17,.99)) !important;
    border-right: 1px solid #203747 !important;
    box-shadow: 16px 0 35px rgba(0,0,0,.15) !important;
}

.admin-sidebar::after,
.admin-side::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 230px;
    pointer-events: none;
    opacity: .10;
    background: url('/images/admin-v3/admin-bg.png') center bottom / cover no-repeat;
}

.admin-topbar,
.admin-top-header,
.admin-header-bar {
    background: rgba(4, 11, 17, .90) !important;
    border-bottom: 1px solid #273d4d !important;
    backdrop-filter: blur(12px);
}

.admin-sidebar a,
.admin-side a,
aside.admin-nav a {
    border-radius: 4px !important;
    color: #9cafbc !important;
    transition: .18s ease !important;
}

.admin-sidebar a:hover,
.admin-side a:hover,
aside.admin-nav a:hover,
.admin-sidebar a.active,
.admin-side a.active,
aside.admin-nav a.active {
    border-color: rgba(209,40,51,.65) !important;
    background:
        linear-gradient(90deg, rgba(126,19,27,.38), rgba(20,18,20,.20)) !important;
    color: #fff !important;
    box-shadow:
        inset 3px 0 0 #d12833,
        0 0 18px rgba(209,40,51,.06) !important;
}

/* ------------------------------------------------------------
   MAIN ADMIN CONTENT
   ------------------------------------------------------------ */

.admin-page,
.admin-item-page,
.admin-player-page,
.admin-news-page,
.admin-webmall-page,
.admin-notification-page,
.admin-point-page,
.admin-daily-login-page,
.admin-event-page,
.admin-transaction-page {
    min-height: 100vh !important;
    padding: 28px 0 75px !important;
    background:
        radial-gradient(circle at 58% 8%, rgba(82, 117, 142, .07), transparent 25%),
        transparent !important;
}

.admin-page > .container,
.admin-item-page > .container,
.admin-player-page > .container,
.admin-news-page > .container,
.admin-webmall-page > .container,
.admin-notification-page > .container,
.admin-point-page > .container,
.admin-daily-login-page > .container,
.admin-event-page > .container,
.admin-transaction-page > .container {
    width: min(1240px, calc(100% - 38px)) !important;
    max-width: 1240px !important;
}

/* ------------------------------------------------------------
   PAGE HEADERS
   ------------------------------------------------------------ */

.admin-header,
.admin-item-header,
.admin-player-header,
.admin-news-header,
.admin-webmall-header,
.admin-point-header,
.admin-notification-header,
.admin-daily-login-header,
.admin-event-header,
.admin-transaction-header {
    position: relative !important;
    overflow: hidden !important;
    min-height: 185px !important;
    margin-bottom: 18px !important;
    padding: 30px 34px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    border: 1px solid rgba(144, 104, 43, .48) !important;
    border-radius: 7px !important;
    background:
        linear-gradient(90deg, rgba(4,10,15,.88), rgba(4,10,15,.47)),
        url('/images/admin-v3/admin-bg.png') center 42% / cover no-repeat !important;
    box-shadow: 0 20px 55px rgba(0,0,0,.26) !important;
}

.admin-header::after,
.admin-item-header::after,
.admin-player-header::after,
.admin-news-header::after,
.admin-webmall-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 80px;
    pointer-events: none;
    background: linear-gradient(180deg, transparent, rgba(3,9,13,.58));
}

.admin-header > *,
.admin-item-header > *,
.admin-player-header > *,
.admin-news-header > *,
.admin-webmall-header > * {
    position: relative;
    z-index: 2;
}

.admin-header > span,
.admin-item-header span:first-child,
.admin-player-header span:first-child,
.admin-news-header span:first-child,
.admin-webmall-header span:first-child {
    color: #ff4c56 !important;
    font-size: 7px !important;
    font-weight: 900 !important;
    letter-spacing: 3px !important;
    text-transform: uppercase !important;
}

.admin-header h1,
.admin-item-header h1,
.admin-player-header h1,
.admin-news-header h1,
.admin-webmall-header h1,
.admin-point-header h1,
.admin-notification-header h1 {
    margin: 6px 0 5px !important;
    color: var(--av3-text) !important;
    font-family: Georgia, "Times New Roman", serif !important;
    font-size: clamp(36px, 4vw, 54px) !important;
    line-height: .98 !important;
    text-shadow: 0 4px 18px rgba(0,0,0,.55) !important;
}

.admin-header p,
.admin-item-header p,
.admin-player-header p,
.admin-news-header p,
.admin-webmall-header p {
    margin: 0 !important;
    color: #a19277 !important;
    font-size: 8px !important;
}

/* ------------------------------------------------------------
   DASHBOARD STATS
   ------------------------------------------------------------ */

.admin-stat-grid,
.admin-item-stats,
.admin-player-stats,
.admin-news-stats {
    gap: 10px !important;
}

.admin-stat-card,
.admin-item-stat,
.admin-player-stat,
.admin-news-stat {
    position: relative !important;
    overflow: hidden !important;
    min-height: 115px !important;
    padding: 16px !important;
    border: 1px solid #2f4657 !important;
    border-radius: 5px !important;
    background:
        radial-gradient(circle at 88% 15%, rgba(199,147,56,.08), transparent 32%),
        linear-gradient(180deg, rgba(9,23,33,.98), rgba(6,16,24,.99)) !important;
    box-shadow: 0 10px 24px rgba(0,0,0,.15) !important;
}

.admin-stat-card::after,
.admin-item-stat::after,
.admin-player-stat::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, #b98331, transparent 72%);
    opacity: .75;
}

.admin-stat-card span,
.admin-item-stat span,
.admin-player-stat span,
.admin-news-stat span {
    color: #71899c !important;
    font-size: 6px !important;
    font-weight: 900 !important;
    letter-spacing: 1.4px !important;
}

.admin-stat-card strong,
.admin-item-stat strong,
.admin-player-stat strong,
.admin-news-stat strong {
    display: block !important;
    margin-top: 11px !important;
    color: #f1ede6 !important;
    font-family: Georgia, serif !important;
    font-size: 27px !important;
}

/* ------------------------------------------------------------
   SECTION TITLES
   ------------------------------------------------------------ */

.admin-section-title,
.admin-player-section-title,
.admin-item-section-title,
.admin-news-section-title {
    margin: 27px 0 10px !important;
}

.admin-section-title > span,
.admin-player-section-title > span,
.admin-item-section-title > span,
.admin-news-section-title > span {
    color: #ff4a54 !important;
    font-size: 6px !important;
    font-weight: 900 !important;
    letter-spacing: 2px !important;
}

.admin-section-title h2,
.admin-player-section-title h2,
.admin-item-section-title h2,
.admin-news-section-title h2 {
    margin: 4px 0 0 !important;
    color: #f0ece5 !important;
    font-family: Georgia, serif !important;
    font-size: 23px !important;
}

/* ------------------------------------------------------------
   DASHBOARD TOOLS / GENERIC CARDS
   ------------------------------------------------------------ */

.admin-tools-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

.admin-tool-card {
    position: relative !important;
    min-height: 178px !important;
    padding: 18px !important;
    overflow: hidden !important;
    border: 1px solid #31495a !important;
    border-radius: 6px !important;
    background:
        radial-gradient(circle at 82% 12%, rgba(197,146,52,.08), transparent 32%),
        linear-gradient(180deg, #091721, #061019) !important;
    color: inherit !important;
    text-decoration: none !important;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease !important;
}

.admin-tool-card::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, #b5802e, transparent 72%);
}

.admin-tool-card:hover {
    transform: translateY(-3px) !important;
    border-color: #8a672c !important;
    box-shadow: 0 16px 32px rgba(0,0,0,.22) !important;
}

.admin-tool-icon {
    width: 48px !important;
    height: 48px !important;
    margin-bottom: 13px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #755827 !important;
    border-radius: 50% !important;
    background: #1a1509 !important;
    color: #e9b953 !important;
    font-family: Georgia, serif !important;
    font-size: 10px !important;
    font-weight: 900 !important;
}

.admin-tool-card h3 {
    margin: 0 0 6px !important;
    color: #f0ece5 !important;
    font-family: Georgia, serif !important;
    font-size: 17px !important;
}

.admin-tool-card p {
    margin: 0 !important;
    color: #72899b !important;
    font-size: 7px !important;
    line-height: 1.65 !important;
}

/* ------------------------------------------------------------
   TABLES / LOGS
   ------------------------------------------------------------ */

.admin-log-card,
.admin-table-card,
.admin-item-card,
.admin-player-card,
.admin-news-card,
.admin-form-card,
.admin-panel,
.roulette-chance-info {
    border: 1px solid #2d4454 !important;
    border-radius: 6px !important;
    background: linear-gradient(180deg, #08151e, #061019) !important;
    box-shadow: 0 12px 26px rgba(0,0,0,.15) !important;
}

.admin-table-wrapper {
    overflow: auto !important;
}

.admin-table {
    width: 100% !important;
    border-collapse: collapse !important;
    color: #a6b5c0 !important;
    font-size: 7px !important;
}

.admin-table th {
    height: 42px !important;
    padding: 0 11px !important;
    border-bottom: 1px solid #2d4353 !important;
    background: #050d13 !important;
    color: #71899d !important;
    font-size: 6px !important;
    font-weight: 900 !important;
    letter-spacing: .9px !important;
}

.admin-table td {
    min-height: 48px !important;
    padding: 10px 11px !important;
    border-bottom: 1px solid rgba(66,89,106,.24) !important;
    background: rgba(7,19,28,.74) !important;
}

.admin-table tbody tr:hover td {
    background: #0a1923 !important;
}

.admin-action-badge {
    border: 1px solid #744f29 !important;
    border-radius: 2px !important;
    background: #171208 !important;
    color: #e0ac4f !important;
}

/* ------------------------------------------------------------
   FORMS / INPUTS / BUTTONS - ALL ADMIN PAGES
   ------------------------------------------------------------ */

.admin-page input,
.admin-page select,
.admin-page textarea,
.admin-item-page input,
.admin-item-page select,
.admin-item-page textarea,
.admin-player-page input,
.admin-player-page select,
.admin-player-page textarea,
.admin-news-page input,
.admin-news-page select,
.admin-news-page textarea,
.admin-webmall-page input,
.admin-webmall-page select,
.admin-webmall-page textarea,
.admin-point-page input,
.admin-point-page select,
.admin-point-page textarea,
.admin-notification-page input,
.admin-notification-page select,
.admin-notification-page textarea {
    border: 1px solid #304758 !important;
    border-radius: 3px !important;
    background: #051019 !important;
    color: #e8edf0 !important;
    box-shadow: none !important;
}

.admin-page input:focus,
.admin-page select:focus,
.admin-page textarea:focus,
.admin-item-page input:focus,
.admin-item-page select:focus,
.admin-item-page textarea:focus,
.admin-player-page input:focus,
.admin-player-page select:focus,
.admin-player-page textarea:focus {
    border-color: #9a712e !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(188,135,48,.08) !important;
}

.admin-page button,
.admin-item-page button,
.admin-player-page button,
.admin-news-page button,
.admin-webmall-page button,
.admin-point-page button,
.admin-notification-page button {
    border-radius: 3px !important;
}

.happy-login-button,
.admin-item-submit,
.admin-player-submit,
.admin-news-submit,
.roulette-weight-save,
.roulette-action-edit,
.admin-tool-primary {
    border: 1px solid #d02d37 !important;
    background: linear-gradient(180deg, #b9222c, #70141a) !important;
    color: #fff !important;
}

/* ------------------------------------------------------------
   STATUS COLORS
   ------------------------------------------------------------ */

.admin-player-active,
.roulette-admin-active,
.status-active,
.admin-status-active {
    color: var(--av3-green) !important;
}

.admin-player-disabled,
.roulette-admin-disabled,
.status-disabled,
.admin-status-disabled {
    color: #ff626c !important;
}

.roulette-admin-jackpot,
.admin-gold-badge {
    border-color: #785c28 !important;
    background: #191408 !important;
    color: #edbd59 !important;
}

/* ------------------------------------------------------------
   SCROLLBARS
   ------------------------------------------------------------ */

body:has(.admin-page) ::-webkit-scrollbar,
body:has(.admin-item-page) ::-webkit-scrollbar,
body:has(.admin-player-page) ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body:has(.admin-page) ::-webkit-scrollbar-track,
body:has(.admin-item-page) ::-webkit-scrollbar-track,
body:has(.admin-player-page) ::-webkit-scrollbar-track {
    background: #061019;
}

body:has(.admin-page) ::-webkit-scrollbar-thumb,
body:has(.admin-item-page) ::-webkit-scrollbar-thumb,
body:has(.admin-player-page) ::-webkit-scrollbar-thumb {
    background: #31495a;
    border-radius: 8px;
}

/* ------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------ */

/* R-COIN WITHDRAW ------------------------------------------------ */
.rcoin-withdraw-page { padding: 34px 34px 60px; }
.rcoin-withdraw-header { position:relative; display:flex; align-items:center; justify-content:space-between; overflow:hidden; min-height:170px; padding:32px 38px; margin-bottom:20px; border:1px solid #334653; background:linear-gradient(115deg,#07131c 0%,#0a1620 62%,#151006 100%); }
.rcoin-withdraw-header::before { content:""; position:absolute; inset:0; background:linear-gradient(90deg,rgba(255,55,64,.12),transparent 28%),repeating-linear-gradient(135deg,transparent 0 24px,rgba(255,255,255,.012) 25px); pointer-events:none; }
.rcoin-withdraw-header > div:first-child { position:relative; z-index:1; }
.rcoin-eyebrow,.rcoin-table-heading span { display:block; margin-bottom:8px; color:#ff3945; font:700 10px/1.2 Arial,sans-serif; letter-spacing:3px; }
.rcoin-withdraw-header h1 { margin:0; color:#f4efe5; font:700 clamp(30px,4vw,52px)/1 Georgia,serif; }
.rcoin-withdraw-header p { max-width:680px; margin:14px 0 0; color:#7890a2; font-size:13px; }
.rcoin-header-mark { position:absolute; right:45px; color:rgba(222,169,55,.1); font:700 150px/1 Georgia,serif; }
.rcoin-filter-tabs { display:flex; gap:8px; padding:8px; margin-bottom:16px; border:1px solid #263946; background:#07121a; }
.rcoin-filter-tabs a { display:flex; align-items:center; gap:8px; padding:12px 18px; border:1px solid transparent; color:#7e95a7; font:700 11px/1 Arial,sans-serif; letter-spacing:1px; text-decoration:none; transition:.2s ease; }
.rcoin-filter-tabs a:hover { color:#fff; border-color:#334b5c; background:#0d1b25; }
.rcoin-filter-tabs a.active { color:#fff; border-color:#a1222a; background:linear-gradient(135deg,#391117,#1b1115); }
.rcoin-filter-dot { width:6px; height:6px; border-radius:50%; background:#4a6172; }
.rcoin-filter-tabs a.active .rcoin-filter-dot { background:#ff3b47; box-shadow:0 0 8px #ff3b47; }
.rcoin-table-card { border:1px solid #314552; background:#07121a; overflow:auto; }
.rcoin-table-heading { display:flex; align-items:center; justify-content:space-between; min-width:1120px; padding:20px 22px; border-bottom:1px solid #314552; background:linear-gradient(90deg,#0b1923,#07121a); }
.rcoin-table-heading span { margin-bottom:5px; }
.rcoin-table-heading strong { color:#f2eee6; font:700 18px/1 Georgia,serif; }
.rcoin-table-heading small { color:#668094; font-size:11px; text-transform:uppercase; letter-spacing:1px; }
.rcoin-withdraw-table { min-width:1120px; margin:0!important; }
.rcoin-withdraw-table th { padding:15px 14px!important; color:#68849a!important; background:#091720!important; font-size:9px!important; letter-spacing:1.5px!important; }
.rcoin-withdraw-table td { padding:17px 14px!important; vertical-align:middle!important; border-color:#1c303d!important; color:#9eb0bd!important; }
.rcoin-withdraw-table tbody tr:hover td { background:#0b1a24!important; }
.rcoin-id { display:inline-flex; padding:5px 8px; border:1px solid #344957; color:#7f97a8; font-weight:700; }
.rcoin-user,.rcoin-rupiah { color:#f5f0e7; }
.rcoin-rupiah { color:#f3bd43; white-space:nowrap; }
.rcoin-unit { color:#5e788b; white-space:nowrap; }
.rcoin-destination { display:grid; gap:4px; min-width:155px; }
.rcoin-destination span { width:max-content; padding:3px 7px; border:1px solid #9b7625; color:#e8b740; font-size:9px; font-weight:800; }
.rcoin-destination strong { color:#e6edf2; }
.rcoin-destination code { color:#8299aa; font:12px Consolas,monospace; }
.rcoin-status { display:inline-flex; align-items:center; padding:6px 9px; border:1px solid; font:800 9px Arial,sans-serif; letter-spacing:1px; }
.rcoin-status-pending { color:#ffc14a; border-color:#70551f; background:#211a08; }
.rcoin-status-approved { color:#35df91; border-color:#176844; background:#082318; }
.rcoin-status-rejected { color:#ff6670; border-color:#782c34; background:#281014; }
.rcoin-date { display:grid; gap:3px; white-space:nowrap; color:#b8c5ce; }.rcoin-date small{color:#587184;}
.rcoin-actions { display:grid; gap:8px; min-width:255px; }
.rcoin-actions form { margin:0; }
.rcoin-action-btn { min-height:36px; padding:0 14px; border:1px solid; color:#fff; font:800 10px Arial,sans-serif; letter-spacing:.8px; }
.rcoin-action-btn.approve { width:100%; border-color:#178759; background:#0b673f; }.rcoin-action-btn.approve:hover{background:#0f8652;}
.rcoin-reject-form { display:grid; grid-template-columns:1fr auto; gap:7px; }
.rcoin-reject-form input { min-width:0; height:36px; padding:0 10px; border:1px solid #3b4e5a; outline:none; background:#050d13; color:#e8edf0; font-size:11px; }.rcoin-reject-form input:focus{border-color:#ca343e;}
.rcoin-action-btn.reject { border-color:#a82932; background:#701921; }.rcoin-action-btn.reject:hover{background:#9b202a;}
.rcoin-processed { display:grid; gap:4px; }.rcoin-processed span{color:#587184;font-size:9px;text-transform:uppercase;letter-spacing:1px}.rcoin-processed strong{color:#dbe5eb}.rcoin-processed small{color:#ff7881;max-width:240px}
.rcoin-empty { padding:50px; text-align:center; color:#5f7788; text-transform:uppercase; letter-spacing:1px; }

@media (max-width:760px){.rcoin-withdraw-page{padding:18px 12px 40px}.rcoin-withdraw-header{min-height:150px;padding:24px 20px}.rcoin-withdraw-header p{font-size:12px}.rcoin-header-mark{right:8px;font-size:110px}.rcoin-filter-tabs{overflow-x:auto}.rcoin-filter-tabs a{flex:0 0 auto;padding:11px 14px}}

@media (max-width: 1050px) {
    .admin-tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 760px) {
    .admin-page > .container,
    .admin-item-page > .container,
    .admin-player-page > .container,
    .admin-news-page > .container,
    .admin-webmall-page > .container {
        width: min(100% - 22px, 1240px) !important;
    }

    .admin-header,
    .admin-item-header,
    .admin-player-header,
    .admin-news-header,
    .admin-webmall-header {
        min-height: 150px !important;
        padding: 23px 18px !important;
    }

    .admin-tools-grid {
        grid-template-columns: 1fr !important;
    }
}
