:root {
    --bg-page: #e0dced;
    --container-white: rgba(255, 255, 255, 0.85);
    --earth-brown: #5e290f;
    --earth-brown-light: #793818;
    --earth-brown-darker: #46200e;
    --sidebar-bg: rgba(248, 247, 252, 0.5);
    --border-light: #cdb591;
    --vibrant-green: #27ae60;
    --vip-purple: #6c5ce7;
    --vip-purple-light: #8678f0;
    --vip-gold: #d4af37;
}

.container-bp {
    display: grid;
    grid-template-columns: 320px 1fr;
    max-width: 100%;
    border-radius: 32px;
    overflow: hidden;
}

/* --- SIDEBAR --- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-right: 1px solid rgba(0,0,0,0.05);
}

.panel {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(255,255,255,0.4);
}

.panel-title {
    background: linear-gradient(135deg, var(--earth-brown-light) 0%, var(--earth-brown) 100%);
    color: white;
    padding: 10px;
    font-weight: 700;
    font-size: 11px;
    text-align: center;
    text-transform: uppercase;
    border-radius: 12px;
    margin-bottom: 15px;
    letter-spacing: 1.2px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.panel-title:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 10px -1px rgba(0, 0, 0, 0.2);
}

.panel-title:active {
    transform: translateY(0px);
    filter: brightness(0.9);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.panel.collapsed .panel-title {
    margin-bottom: 0;
}

.panel-title::after {
    content: '?';
    font-size: 8px;
}

.panel.collapsed .panel-title::after {
    content: '?';
}

.panel.collapsed .collapsible-content {
    display: none;
}

.level-value {
    font-size: 72px;
    font-weight: 900;
    color: var(--earth-brown);
    text-align: center;
    line-height: 1;
    margin: 5px 0;
}

.bar-container {
    background: rgba(0,0,0,0.05);
    height: 14px;
    border-radius: 20px;
    position: relative;
    margin: 15px 0;
}
.bar-fill {
    background: linear-gradient(90deg, #58d68d, var(--vibrant-green));
    height: 100%;
    max-width: 100%;
    overflow: hidden;
}
.bar-text {
    position: absolute;
    width: 100%;
    font-size: 14px;
    line-height: 14px;
    font-weight: 800;
    color: #333;
    bottom: 20px;
    text-align: right;
}

.vip-status-badge {
    color:#27ae60; background: rgba(232, 245, 233, 0.8); padding: 4px 12px; border-radius: 8px; font-size: 14px; font-weight: 700; display: inline-block; margin-top: 5px;
    letter-spacing: 1px;
}

.vip-status-badge--inactive {
    color: #890707;
    background: rgba(249, 185, 185, 0.8);
}

label { font-size: 10px; font-weight: 800; color: #444; text-transform: uppercase; display: block; margin-top: 15px; letter-spacing: 0.5px; }

.form-control {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    margin-top: 5px;
    font-size: 12px;
    box-sizing: border-box;
    background: rgba(255,255,255,0.9);
    color: #333;
    font-weight: 400;
    font-family: 'Poppins', sans-serif;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23793818%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px top 50%;
    background-size: 10px auto;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--earth-brown);
    box-shadow: 0 0 0 3px rgba(121, 56, 24, 0.08);
}

.note-text {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    background: rgba(255, 230, 193, 0.3);
    padding: 15px;
    border-radius: 16px;
    border: 1px dashed var(--border-light);
    margin-bottom: 12px;
}

.counter-group { display: flex; height: 48px; margin-top: 8px; border-radius: 12px; overflow: hidden; border: 1.5px solid rgba(0,0,0,0.05); }
.btn-counter,
.bootstrap-touchspin-down,
.bootstrap-touchspin-up {
    background: white !important;
    border: none !important;
    width: 100% !important;
    cursor: pointer;
    font-weight: 800;
    color: var(--earth-brown) !important;
    font-size: 18px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    border-radius: 0;
    padding: 0 !important;
    height: 48px;
}

.panel label {
    font-size: 14px !important;
}

.input-group {
    margin-right: 0 !important;
    width: 100% !important;
}

.input-group-btn {
    display: block;
    width: 100%;
}

.btn-counter:hover,
.bootstrap-touchspin-down:hover,
.bootstrap-touchspin-up:hover { background: #f0f0f0 !important; }
.counter-input { width: 40%; text-align: center; font-weight: 800; border: none; border-left: 1.5px solid rgba(0,0,0,0.05); border-right: 1.5px solid rgba(0,0,0,0.05); color: var(--earth-brown); background: rgba(250, 250, 250, 0.5); font-size: 14px; }

.main-content { padding: 0 30px; display: flex; flex-direction: column; gap: 25px; background: transparent; min-width: 0; }

.section-card {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.section-header {
    padding: 18px 25px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--earth-brown-light) 0%, var(--earth-brown) 100%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 13px;
    color: white;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 2;
}

.quest-scroll { overflow-y: auto; max-height: 400px; }
.quest-table, .reward-table { width: 100%; border-collapse: collapse; }

/* Updated Table Header to be Solid */
.quest-table th, .reward-table th {
    background: #ffffff;
    color: #555;
    padding: 15px 25px;
    font-size: 10px;
    text-transform: uppercase;
    text-align: left;
    position: sticky;
    top: 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    z-index: 5;
    opacity: 1;
}

/* Added Hover Effect to Table Rows */
.quest-table tbody tr:hover, .reward-table tbody tr:hover {
    background: rgba(255, 208, 143, 0.2) !important;
}

.reward-table tbody tr:hover {
    background: rgba(232, 222, 255, 0.2) !important;
}

.quest-table td, .reward-table td { padding: 18px 25px; border-bottom: 1px solid rgba(0,0,0,0.02); font-size: 12.5px; transition: background 0.2s ease; }

.reward-header-single {
    padding: 15px 25px;
    background: linear-gradient(135deg, var(--earth-brown-light) 0%, var(--earth-brown) 100%);
    color: white;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 2;
}

.reward-claim-bar {
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
}

.reward-scroll { overflow-y: auto; max-height: 500px; scroll-behavior: smooth; }

.reward-table tr.current { background: rgba(108, 92, 231, 0.05); border-left: 5px solid var(--earth-brown); }
.reward-table tr.locked { opacity: 0.4; }

.item-row-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-name { font-size: 13px; font-weight: 700; color: #333; }
.vip-reward-text { color: var(--vip-purple); }

.btn-main {
    background: var(--earth-brown);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.btn-main:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(121, 56, 24, 0.2);
}
.btn-main:active {
    transform: translateY(0px);
    filter: brightness(0.9);
    box-shadow: none;
}
.btn-vip { background: var(--vip-purple); }
.btn-vip:hover { box-shadow: 0 6px 12px rgba(108, 92, 231, 0.2); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 10px; }

@media (max-width: 1200px) {
    .container-bp { grid-template-columns: 1fr; width: 100%; height: auto; }
    .sidebar { border-right: none; border-bottom: 1px solid rgba(0,0,0,0.05); }
    .main-content { padding: 0; }
}
