/* =============================================
   PROXY BASIC THEME - CSS
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:   #2563eb;
    --primary-d: #1d4ed8;
    --success:   #16a34a;
    --danger:    #dc2626;
    --warning:   #d97706;
    --bg:        #f1f5f9;
    --sidebar-bg:#1e293b;
    --sidebar-w: 230px;
    --text:      #1e293b;
    --text-muted:#64748b;
    --border:    #e2e8f0;
    --card:      #ffffff;
    --radius:    8px;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    min-height: 100vh;
    position: fixed;
    top: 0; left: 0;
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform .25s;
}
.sidebar-logo {
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}
.sidebar-logo span { color: #60a5fa; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: #94a3b8;
    text-decoration: none;
    transition: background .15s, color .15s;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255,255,255,.07);
    color: #fff;
    border-left-color: var(--primary);
}
.sidebar-nav a svg { flex-shrink: 0; }
.sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,.08);
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.7;
}
.sidebar-footer strong { color: #e2e8f0; }

/* TOPBAR */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 99;
}
.topbar-title { font-weight: 600; font-size: 16px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.balance-badge {
    background: #eff6ff;
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}
.btn-logout {
    background: none;
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
}
.btn-logout:hover { background: #fee2e2; color: var(--danger); border-color: var(--danger); }

/* MAIN */
.main {
    margin-left: var(--sidebar-w);
    margin-top: 56px;
    padding: 24px;
    flex: 1;
    width: calc(100% - var(--sidebar-w));
    min-width: 0;
}

/* CARD */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    padding: 20px;
    margin-bottom: 20px;
}
.card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* FORM */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 13px;
}
.form-control,
.form-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
}
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.form-control[disabled],
.form-control[readonly] {
    background: var(--bg);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .15s, transform .1s;
    line-height: 1;
}
.btn:active { transform: scale(.98); }
.btn:hover  { opacity: .85; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-block { width: 100%; justify-content: center; }
.btn-sm    { padding: 5px 12px; font-size: 12px; }

/* GRID */
.row   { display: flex; flex-wrap: wrap; gap: 16px; }
.col   { flex: 1 1 0; min-width: 0; }
.col-2 { flex: 0 0 calc(50% - 8px); min-width: 0; }
.col-3 { flex: 0 0 calc(33.333% - 11px); min-width: 0; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { background: var(--bg); }
th, td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
th { font-weight: 700; color: var(--text-muted); font-size: 12px; text-transform: uppercase; }
tr:hover td { background: #f8fafc; }

/* ALERTS */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.6;
}
.alert-success { background: #dcfce7; color: #166534; border-left: 4px solid var(--success); }
.alert-danger  { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid var(--warning); }
.alert-info    { background: #eff6ff; color: #1e40af; border-left: 4px solid var(--primary); }

/* BADGES */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #eff6ff; color: #1e40af; }

/* PAGE HEADER */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.page-title { font-size: 20px; font-weight: 700; }

/* QR BOX */
.qr-box { text-align: center; padding: 16px 0; }
.qr-box img {
    max-width: 280px;
    width: 100%;
    border: 4px solid #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,.12);
    margin-bottom: 14px;
}
.trans-code {
    background: #eff6ff;
    border: 1.5px dashed var(--primary);
    border-radius: 8px;
    padding: 10px 16px;
    margin: 0 auto 14px;
    font-weight: 700;
    color: var(--primary);
    font-size: 15px;
    max-width: 420px;
}

/* INCLUDE WRAPPER */
.include-wrap { line-height: 1.5; }

/* UTILITY */
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-center  { text-align: center; }
.fw-bold      { font-weight: 700; }
.mt-2  { margin-top: 8px; }
.mt-4  { margin-top: 16px; }
.mb-2  { margin-bottom: 8px; }
.mb-4  { margin-bottom: 16px; }
small.text-muted { font-size: 12px; display:block; margin-top:3px; }

/* HAMBURGER */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text);
}

/* SIDEBAR OVERLAY mobile */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 150;
}
#sidebar-overlay.show { display: block; }

/* LOGIN PAGE */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}
.login-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,.1);
    padding: 36px 32px;
    width: 100%;
    max-width: 380px;
}
.login-box h1 {
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 6px;
}
.login-box p.sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 24px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-230px); }
    .sidebar.open { transform: translateX(0); }
    .topbar { left: 0; }
    .main { margin-left: 0; padding: 16px; width: 100%; }
    .hamburger { display: block; }
    .balance-badge { font-size: 12px; padding: 3px 8px; }
    .btn-logout { display: none; }
    .col-2, .col-3 { flex: 0 0 100%; }
    .topbar-title { font-size: 14px; }
}
