/* =====================================================
   PT GOXPAY DIGITAL SOLUTIONS – Admin CSS v2
   ===================================================== */

:root {
    --bg:           #07091a;
    --bg2:          #0c1128;
    --sidebar:      #080e20;
    --sidebar-w:    250px;
    --primary:      #0066ff;
    --accent:       #00d4ff;
    --text:         #dde4f5;
    --text-muted:   #6a7a9d;
    --card:         rgba(255,255,255,0.04);
    --card-border:  rgba(0,102,255,0.18);
    --danger:       #ff4757;
    --success:      #00c86a;
    --warning:      #ffb700;
    --radius:       12px;
    --shadow:       0 4px 24px rgba(0,0,0,0.45);
}

/* ── Reset ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 200;
    transition: left 0.3s ease;
    overflow-y: auto;
}

/* Mobile: sidebar slides in from left */
@media (max-width: 768px) {
    .sidebar {
        left: -270px;  /* fully off-screen */
    }
    .sidebar.open {
        left: 0;
        box-shadow: 4px 0 40px rgba(0,0,0,0.6);
    }
}

/* Sidebar Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 18px;
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}
.logo-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: #fff;
    box-shadow: 0 4px 16px rgba(0,102,255,0.4);
}
.logo-icon img { width:100%; height:100%; object-fit:contain; border-radius:11px; }
.logo-name { font-weight: 700; font-size: 0.95rem; color: #fff; line-height: 1.2; }
.logo-sub  { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* Nav */
.sidebar-nav { flex: 1; padding: 14px 10px; display: flex; flex-direction: column; gap: 3px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    border-radius: 9px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}
.nav-item:hover  { background: rgba(255,255,255,0.05); color: var(--text); }
.nav-item.active { background: rgba(0,102,255,0.15); color: var(--primary); font-weight: 600; border-left: 3px solid var(--primary); padding-left: 11px; }
.nav-icon { font-size: 0.95rem; width: 20px; text-align: center; flex-shrink: 0; }

/* Footer */
.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--card-border); flex-shrink: 0; }
.logout-btn:hover { background: rgba(255,71,87,0.12) !important; color: var(--danger) !important; }
.sidebar-user { font-size: 0.72rem; color: var(--text-muted); padding: 8px 14px 2px; }
.sidebar-user strong { color: var(--text); }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 190;
}
.sidebar-overlay.show { display: block; }

/* =====================================================
   TOP BAR
   ===================================================== */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; transition: margin-left 0.3s; }

@media (max-width: 768px) {
    .main { margin-left: 0; }
}

.topbar {
    background: var(--bg2);
    border-bottom: 1px solid var(--card-border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky; top: 0; z-index: 100;
    gap: 12px;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar h1 { font-size: 1.15rem; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { font-size: 0.75rem; color: var(--text-muted); }

/* Hamburger toggle (mobile) */
.sidebar-toggle {
    display: none;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    width: 38px; height: 38px;
    align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text);
    font-size: 1rem;
    flex-shrink: 0;
}
@media (max-width: 768px) {
    .sidebar-toggle { display: flex; }
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.content { padding: 24px 28px; flex: 1; }

@media (max-width: 768px) {
    .content { padding: 16px; }
    .topbar  { padding: 12px 16px; }
}

/* =====================================================
   STAT CARDS
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 22px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: border-color 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: var(--radius) var(--radius) 0 0;
}
.stat-card:hover { border-color: rgba(0,102,255,0.4); transform: translateY(-2px); }
.stat-icon-wrap {
    width: 52px; height: 52px;
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.stat-icon-wrap.blue  { background: rgba(0,102,255,0.15);  color: var(--primary); }
.stat-icon-wrap.cyan  { background: rgba(0,212,255,0.15);  color: var(--accent); }
.stat-icon-wrap.green { background: rgba(0,200,106,0.15);  color: var(--success); }
.stat-icon-wrap.warn  { background: rgba(255,183,0,0.15);  color: var(--warning); }
.stat-body { min-width: 0; }
.stat-number {
    font-size: 2rem; font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}
.stat-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 5px; }

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 20px;
}
.card-title {
    font-size: 0.95rem; font-weight: 700; color: #fff;
    margin-bottom: 18px;
    display: flex; align-items: center; gap: 9px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--card-border);
}
.card-title i { color: var(--primary); font-size: 0.9rem; }

/* =====================================================
   QUICK LINKS
   ===================================================== */
.quick-links { display: flex; gap: 12px; flex-wrap: wrap; }
.quick-link {
    display: flex; align-items: center; gap: 9px;
    padding: 11px 18px;
    background: rgba(0,102,255,0.06);
    border: 1px solid rgba(0,102,255,0.2);
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}
.quick-link i { color: var(--primary); font-size: 0.85rem; }
.quick-link:hover { background: rgba(0,102,255,0.15); border-color: var(--primary); color: #fff; transform: translateY(-2px); }
@media (max-width: 480px) {
    .quick-link { width: calc(50% - 6px); justify-content: center; padding: 10px 10px; }
}

/* =====================================================
   FORMS
   ===================================================== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.03em; }
.form-control {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--card-border);
    border-radius: 9px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s, background 0.2s;
    outline: none;
}
.form-control:focus { border-color: var(--primary); background: rgba(0,102,255,0.07); }
textarea.form-control { resize: vertical; min-height: 110px; }
select.form-control { cursor: pointer; }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px;
    border-radius: 9px;
    font-size: 0.88rem; font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #0055dd; box-shadow: 0 4px 20px rgba(0,102,255,0.4); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #00a055; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-danger:hover  { background: #cc0020; }
.btn-outline { background: transparent; border: 1px solid var(--card-border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }

@media (max-width: 480px) {
    .btn { padding: 9px 14px; font-size: 0.85rem; }
}

/* =====================================================
   TABLE
   ===================================================== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 480px; }
th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}
td { padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.88rem; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* Badges */
.badge {
    display: inline-block; padding: 3px 10px;
    border-radius: 20px; font-size: 0.73rem; font-weight: 600;
}
.badge-success { background: rgba(0,200,100,0.12); color: var(--success); border: 1px solid rgba(0,200,100,0.3); }
.badge-danger  { background: rgba(255,71,87,0.12);  color: var(--danger);  border: 1px solid rgba(255,71,87,0.3); }
.badge-warning { background: rgba(255,183,0,0.12);  color: var(--warning); border: 1px solid rgba(255,183,0,0.3); }

/* =====================================================
   ALERTS
   ===================================================== */
.alert { padding: 12px 16px; border-radius: 9px; margin-bottom: 20px; font-size: 0.88rem; display: flex; align-items: center; gap: 10px; }
.alert-success { background: rgba(0,200,100,0.08); border: 1px solid rgba(0,200,100,0.3); color: var(--success); }
.alert-danger  { background: rgba(255,71,87,0.08);  border: 1px solid rgba(255,71,87,0.3);  color: var(--danger); }

/* =====================================================
   IMAGE / UPLOAD
   ===================================================== */
.img-preview { width: 80px; height: 60px; object-fit: cover; border-radius: 7px; border: 1px solid var(--card-border); background: var(--bg2); }
.logo-preview { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; background: #fff; padding: 4px; }
.upload-area {
    border: 2px dashed var(--card-border);
    border-radius: 9px; padding: 20px;
    text-align: center; cursor: pointer;
    transition: border-color 0.2s;
    color: var(--text-muted); font-size: 0.85rem;
}
.upload-area:hover { border-color: var(--primary); color: var(--primary); }
.upload-area i { font-size: 1.6rem; display: block; margin-bottom: 8px; }
.upload-area input[type=file] { display: none; }

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.7); z-index: 500;
    align-items: flex-start; justify-content: center;
    padding: 40px 16px;
    overflow-y: auto;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: var(--bg2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 28px 24px;
    width: 100%; max-width: 600px;
    position: relative;
    margin: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 1.05rem; font-weight: 700; color: #fff; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: rgba(255,255,255,0.08); color: var(--text); }

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(0,102,255,0.15) 0%, transparent 60%), var(--bg);
    padding: 20px;
}
.login-box { width: 420px; max-width: 100%; }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .big-icon {
    width: 68px; height: 68px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; color: #fff; margin: 0 auto 14px;
    box-shadow: 0 8px 32px rgba(0,102,255,0.45);
}
.login-logo h1 { font-size: 1.3rem; font-weight: 700; color: #fff; }
.login-logo p  { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

/* =====================================================
   GRID HELPERS
   ===================================================== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* =====================================================
   INFO TABLE (dashboard)
   ===================================================== */
.info-table { width: 100%; }
.info-table td { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.88rem; }
.info-table td:first-child { color: var(--text-muted); width: 40%; font-size: 0.82rem; }
.info-table tr:last-child td { border-bottom: none; }

/* =====================================================
   RESPONSIVE UTILITIES
   ===================================================== */
@media (max-width: 768px) {
    .hide-mobile { display: none; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 16px 14px; gap: 12px; }
    .stat-icon-wrap { width: 42px; height: 42px; font-size: 1.1rem; }
    .stat-number { font-size: 1.6rem; }
}
@media (max-width: 380px) {
    .stats-grid { grid-template-columns: 1fr; }
}
