.cur-switch { position: relative; }
.cur-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #ffffff; border-radius: 999px;
    padding: 5px 10px; font-size: 12px; font-weight: 700;
    cursor: pointer; line-height: 1;
}
.cur-btn .cur-arrow { width: 12px; height: 12px; transition: transform .2s; }
.cur-switch.open .cur-arrow { transform: rotate(180deg); }
.cur-flag { font-size: 16px; line-height: 1; }
.cur-menu {
    display: none; position: absolute; right: 0; top: calc(100% + 8px);
    width: 190px; max-height: 320px; overflow-y: auto;
    background: #ffffff; color: #713516;
    border: 1px solid #E7D9CC; border-radius: 10px;
    box-shadow: 0 10px 30px rgba(143, 53, 15, 0.22);
    padding: 4px; margin: 0; list-style: none; z-index: 500;
}
.cur-switch.open .cur-menu { display: block; }
.cur-opt {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 8px;
    font-size: 14px; font-weight: 600; cursor: pointer;
}
.cur-opt:hover { background: #FFF1E3; }
.cur-opt.active { background: #FF6500; color: #ffffff; }

.topbar .brand { white-space: nowrap; }
@media (max-width: 480px) {
    .topbar { padding: 12px 12px; }
    .topbar .brand { font-size: 16px; }
    .topbar .balance-pill { padding: 5px 10px; font-size: 12px; }
    .cur-btn { padding: 4px 8px; font-size: 11px; }
}

.topbar:not(.tb-user) .hamburger-btn {
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 6px !important;
    padding: 6px 10px !important;
    background: transparent !important;
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sidebar.sb-user {
    width: min(80vw, 250px);
    left: calc(-1 * min(80vw, 250px) - 12px);
    background: linear-gradient(180deg, #fff4e8 0%, #ffecd9 100%);
    border-right: 1px solid #f1c9a3;
    padding-bottom: 20px;
}
.sidebar.sb-user.open { left: 0; }
@media (min-width: 992px) {
    .sidebar.sb-user { left: 0; width: 250px; }
    .sb-close { display: none !important; }
}

.sb-top {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    padding: 14px 40px 6px 14px; min-height: 56px;
}
.sb-logo { display: block; text-decoration: none; text-align: center; }
.sb-logo img { max-height: 34px; max-width: 100%; width: auto; height: auto; display: block; margin: 0 auto; }
.sb-logo-text { font-size: 20px; font-weight: 800; color: #e8650a; }
.sb-close {
    position: absolute; top: 10px; right: 10px;
    width: 22px; height: 22px; padding: 0; margin: 0;
    border: 0; border-radius: 50%;
    background: #e8650a; color: #ffffff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.sb-close svg { width: 10px; height: 10px; }

.sb-profile {
    position: relative;
    margin: 6px 14px 12px; padding: 12px 10px; text-align: center;
    border-radius: 12px; border: 1px solid #e79a5c;
    background: linear-gradient(135deg, #fff0e0 0%, #ffcfa3 100%);
}
.sb-level-badge { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; object-fit: contain; }
.sb-soon-toast {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
    background: #3a2414; color: #fff; padding: 10px 18px; border-radius: 999px;
    font-size: 13.5px; font-weight: 600; opacity: 0; pointer-events: none;
    transition: opacity .25s, transform .25s; z-index: 2000;
}
.sb-soon-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.sb-avatar {
    width: 70px; height: 70px; margin: 0 auto 6px;
    border-radius: 50%; overflow: hidden; background: #ffffff;
    border: 2px solid #ffffff; box-shadow: 0 2px 6px rgba(150, 60, 10, 0.22);
}
.sb-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-username { font-size: 16px; font-weight: 700; color: #c2500b; margin-bottom: 8px; word-break: break-word; line-height: 1.2; }
.sb-balance-row { display: inline-flex; align-items: center; gap: 6px; }
.sb-balance {
    background: #d9631a; color: #ffffff; font-weight: 700; font-size: 12.5px;
    padding: 4px 12px; border-radius: 999px; line-height: 1.3;
}
.sb-plus {
    width: 20px; height: 20px; border-radius: 50%;
    background: #6b8e0f; color: #ffffff; text-decoration: none;
    display: flex; align-items: center; justify-content: center;
}
.sb-plus svg { width: 11px; height: 11px; }

.sb-player {
    margin: 0 14px 12px; padding: 8px 10px;
    display: flex; align-items: center; gap: 10px;
    border-radius: 12px; background: linear-gradient(135deg, #ffeedd 0%, #ffcfa3 100%);
}
.sb-player-thumb {
    width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #5b3fa0, #1a1440);
    border: 2px solid #e8650a; color: #ffffff;
    display: flex; align-items: center; justify-content: center;
}
.sb-player-thumb svg { width: 20px; height: 20px; }
.sb-player-body { flex: 1; min-width: 0; }
.sb-ctrls { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 4px; }
.sb-btn {
    background: none; border: 0; padding: 2px; margin: 0; cursor: pointer;
    color: #6b8e0f; display: flex; align-items: center; justify-content: center;
}
.sb-btn svg { width: 13px; height: 13px; }
.sb-play {
    width: 32px; height: 32px; padding: 0; border-radius: 50%;
    background: #7b8f0f; color: #ffffff;
    box-shadow: 0 2px 6px rgba(100, 110, 10, 0.3);
}
.sb-play svg { width: 15px; height: 15px; }
.sb-vol { display: flex; align-items: center; gap: 6px; color: #6b8e0f; }
.sb-vol svg { width: 15px; height: 15px; flex-shrink: 0; }
.sb-vol input[type="range"] { flex: 1; min-width: 0; height: 3px; accent-color: #7b8f0f; cursor: pointer; }

.sb-group { margin: 0 0 8px; }
.sb-ghead {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; margin: 0; border: 0; cursor: pointer; text-align: left;
    background: #fde3cc; color: #c2500b;
    font-size: 14px; font-weight: 700; letter-spacing: 0.2px; text-transform: uppercase;
}
.sb-arrow { width: 10px; height: 10px; flex-shrink: 0; transition: transform 0.2s ease; }
.sb-group.open .sb-ghead { background: linear-gradient(90deg, #a63d0a 0%, #ff6a00 100%); color: #ffffff; }
.sb-group.open .sb-arrow { transform: rotate(90deg); }
.sb-gbody {
    display: none; margin: 0 14px; padding: 6px 6px 8px;
    background: #fce2cc; border-radius: 0 0 12px 12px;
}
.sb-group.open .sb-gbody { display: block; }
.sb-item {
    position: relative; display: flex; align-items: center; gap: 12px;
    padding: 8px 10px; border-radius: 10px; text-decoration: none;
    color: #a4531f; font-size: 14.5px; font-weight: 500; line-height: 1.2;
}
.sb-item:hover { background: rgba(255, 255, 255, 0.45); }
.sb-item.active { background: rgba(255, 255, 255, 0.6); color: #7a3300; font-weight: 600; }
.sb-item.active::before {
    content: ''; position: absolute; left: -6px; top: 50%; transform: translateY(-50%);
    width: 6px; height: 20px; background: #6b8e0f; border-radius: 0 5px 5px 0;
}
.sb-ico {
    width: 22px; height: 22px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.sb-ico svg { width: 20px; height: 20px; }
.sb-badge {
    margin-left: auto; background: #ef4444; color: #ffffff;
    font-size: 10px; font-weight: 700; line-height: 1;
    padding: 3px 6px; border-radius: 999px; min-width: 16px; text-align: center;
}
.sb-logout { display: flex; align-items: center; gap: 12px; margin: 14px 20px 4px; text-decoration: none; }
.sb-logout-ico {
    width: 42px; height: 42px; padding: 3px; flex-shrink: 0;
    border: 1.5px solid #e8650a; border-radius: 50%; display: flex;
}
.sb-logout-ico > span {
    flex: 1; border-radius: 50%; color: #ffffff;
    background: linear-gradient(135deg, #c2410c, #ff7a1a);
    display: flex; align-items: center; justify-content: center;
}
.sb-logout-ico svg { width: 18px; height: 18px; }
.sb-logout-txt { color: #e8650a; font-size: 15px; font-weight: 700; text-decoration: underline; }

.sidebar-nav .nav-item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: #334155;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-item-link:hover {
    background: #f1f5f9;
    color: #b44200;
}

.sidebar-nav .nav-item-link.active {
    background: #fff5f0;
    color: #b44200;
}

.sidebar-nav .nav-icon-box {
    width: 32px;
    height: 32px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b44200;
    flex-shrink: 0;
}

.sidebar-nav .nav-item-link.active .nav-icon-box {
    background: #b44200;
    color: #ffffff;
    border-color: #b44200;
}

.sidebar-nav .nav-icon-box svg {
    width: 16px;
    height: 16px;
}

.nav-badge-count {
    margin-left: auto;
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.logout-link {
    margin: 0 10px;
}

.table-card {
    background: #ffffff;
    border: 1px solid #f1e5dd;
    border-radius: 16px;
    overflow: hidden !important; 
}

.scroll-notice {
    padding: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #b44200;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-bottom: 1px solid #f1e5dd;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.orders-table {
    width: 100%;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    white-space: nowrap;
    margin: 0;
    padding: 0;
    border: none !important;
}

.orders-table thead,
.orders-table thead tr {
    background: #b44200 !important;
}

.orders-table th {
    background: #b44200 !important;
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 700;
    padding: 12px 14px;
    text-align: left;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.orders-table th:first-child {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 12px !important;
}

.orders-table th:last-child {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 12px !important;
}

.orders-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f8fafc;
    font-size: 13px;
    color: #334155;
    vertical-align: middle;
}

.topbar { position: sticky !important; top: 0 !important; z-index: 100 !important; }
.cur-menu[hidden], .tb-acct-menu[hidden] { display: none !important; }
.hamburger-btn svg { width: 20px; height: 20px; display: block; }

.topbar.tb-user {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    min-height: 72px; padding: 18px 24px;
    background: linear-gradient(90deg, #fffbf3 0%, #fff2dc 55%, #fde5c6 100%) !important;
    color: #e07020; box-shadow: 0 1px 0 rgba(224, 112, 32, 0.14); border: 0;
}
.tb-user .hamburger-btn {
    width: 36px; height: 36px; padding: 0; flex-shrink: 0; margin: 0;
    display: flex; align-items: center; justify-content: center;
    background: #e2702a !important; color: #ffffff !important; border: 0 !important; border-radius: 10px !important; cursor: pointer;
}
@media (min-width: 992px) {
    .tb-user .hamburger-btn { display: none !important; }
}
.tb-right { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0; }

.tb-theme {
    display: flex; align-items: center; gap: 6px; height: 34px; padding: 2px; margin: 0; flex-shrink: 0;
    background: transparent; border: 2px solid #e07020; border-radius: 999px; cursor: pointer;
}
.tb-theme span {
    width: 26px; height: 26px; border-radius: 50%; color: #e07020;
    display: flex; align-items: center; justify-content: center;
}
.tb-theme span svg { width: 16px; height: 16px; }
.tb-theme span.on { background: linear-gradient(135deg, #e8650a, #c74700); color: #ffffff; box-shadow: 0 0 0 2px #ffffff inset; }

.tb-user .cur-switch { position: relative; flex-shrink: 0; }
.tb-user .cur-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; margin: 0; padding: 0 8px 0 3px;
    background: transparent; border: 2px solid #e07020; color: #e07020; border-radius: 999px;
    font-size: 14px; font-weight: 600; line-height: 1; cursor: pointer; white-space: nowrap;
}
.tb-user .cur-btn.cur-static { padding-right: 12px; cursor: default; }
.tb-user .cur-flag {
    width: 24px; height: 24px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center; font-size: 17px; line-height: 1; background: #ffffff;
}
.tb-user .cur-opt .cur-flag { background: transparent; }
.tb-chev { width: 14px; height: 14px; flex-shrink: 0; transition: transform 0.2s ease; }
.cur-switch.open .tb-chev, .tb-acct.open .tb-chev { transform: rotate(180deg); }
.tb-user .cur-menu {
    right: 0; left: auto; top: calc(100% + 10px); width: 190px; max-height: 320px;
    background: #ffffff; color: #713516; border: 1px solid #e7d9cc; border-radius: 12px;
    box-shadow: 0 10px 28px rgba(143, 53, 15, 0.22);
}

.tb-acct { position: relative; flex-shrink: 0; }
.tb-acct-btn {
    display: flex; align-items: center; gap: 8px; height: 34px; margin: 0; padding: 2px 10px 2px 2px;
    background: linear-gradient(90deg, #e8650a 0%, #a63d0a 100%); color: #ffffff; border: 0; border-radius: 999px; cursor: pointer;
}
.tb-acct-btn img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 2px solid #ffffff; background: #ffffff; display: block; }
.tb-acct-menu {
    position: absolute; right: 0; top: calc(100% + 10px); width: 172px; z-index: 500;
    background: #ffffff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 10px 28px rgba(143, 53, 15, 0.22);
}
.tb-acct-menu a {
    display: flex; align-items: center; gap: 12px; padding: 13px 16px;
    color: #222222; font-size: 16px; font-weight: 500; line-height: 1.2; text-decoration: none;
    border-bottom: 1px solid #efefef;
}
.tb-acct-menu a svg { width: 18px; height: 18px; flex-shrink: 0; }
.tb-acct-menu a:hover { background: #fff6ec; }
.tb-acct-menu a.tb-logout { background: linear-gradient(90deg, #8a9b0f 0%, #66700f 100%); color: #ffffff; border-bottom: 0; }

@media (max-width: 380px) {
    .topbar.tb-user { padding: 14px 12px; }
    .tb-right { gap: 6px; }
    .tb-user .cur-btn { font-size: 12.5px; padding-right: 6px; }
}

:root[data-theme="dark"] {
    --color-primary: #ff7a1f;
    --color-primary-dark: #ff9a4d;
    --color-primary-darker: #ffb37a;
    --color-bg: #14100c;
    --color-card: #211a14;
    --color-border: #3a2e22;
    --color-text: #f0e4d8;
    --color-text-muted: #b6a390;
    --color-success: #8fc24a;
    --color-danger: #ff6b5e;
    --color-warning: #ffcf6b;
}
[data-theme="dark"] body { background: var(--color-bg) !important; color: var(--color-text) !important; }

[data-theme="dark"] .topbar.tb-user {
    background: linear-gradient(90deg, #1c150f 0%, #241a10 55%, #2c1e11 100%) !important;
    color: #ffb37a !important; box-shadow: 0 1px 0 rgba(0, 0, 0, .4) !important;
}
[data-theme="dark"] .tb-theme { border-color: #ffb37a !important; }
[data-theme="dark"] .tb-theme span { color: #ffb37a !important; }
[data-theme="dark"] .tb-user .cur-btn { border-color: #ffb37a !important; color: #ffb37a !important; }
[data-theme="dark"] .tb-user .cur-menu, [data-theme="dark"] .tb-acct-menu {
    background: #241a10 !important; color: #f0e4d8 !important; border-color: #3a2e22 !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .5) !important;
}
[data-theme="dark"] .tb-user .cur-opt:hover, [data-theme="dark"] .tb-acct-menu a:hover { background: #33261a !important; }
[data-theme="dark"] .tb-acct-menu a { color: #f0e4d8 !important; border-bottom-color: #3a2e22 !important; }
[data-theme="dark"] .sidebar.sb-user {
    background: linear-gradient(180deg, #1c150f 0%, #17120c 100%) !important;
    border-right-color: #3a2e22 !important;
}
[data-theme="dark"] .sb-logo-text { color: #ff9a4d !important; }
[data-theme="dark"] .sb-profile { background: linear-gradient(135deg, #241a10 0%, #33230f 100%) !important; border-color: #4a3620 !important; }
[data-theme="dark"] .sb-username { color: #ffb37a !important; }
[data-theme="dark"] .sb-player { background: linear-gradient(135deg, #241a10 0%, #33230f 100%) !important; }
[data-theme="dark"] .sb-ghead { background: #2a2016 !important; color: #ffb37a !important; }
[data-theme="dark"] .sb-gbody { background: #221a12 !important; }
[data-theme="dark"] .sb-item { color: #d8c4ac !important; }
[data-theme="dark"] .sb-item:hover, [data-theme="dark"] .sb-item.active { background: rgba(255, 154, 77, .12) !important; color: #ffcf9e !important; }
[data-theme="dark"] .sb-soon-toast { background: #ff9a4d !important; color: #1c150f !important; }

[data-theme="dark"] .dv-card, [data-theme="dark"] .up-card, [data-theme="dark"] .cp-card,
[data-theme="dark"] .ch-card, [data-theme="dark"] .ch-item, [data-theme="dark"] .gv-card,
[data-theme="dark"] .gv-details-card, [data-theme="dark"] .gv-modal, [data-theme="dark"] .ga-card,
[data-theme="dark"] .ga-task, [data-theme="dark"] .af-card, [data-theme="dark"] .aa-card,
[data-theme="dark"] .ac-card, [data-theme="dark"] .ad-card, [data-theme="dark"] .mo-card,
[data-theme="dark"] .sd-card, [data-theme="dark"] .sd-status, [data-theme="dark"] .sd-lv-col,
[data-theme="dark"] .sd-lv-labels, [data-theme="dark"] .sa-card, [data-theme="dark"] .sa-level,
[data-theme="dark"] .fq-item, [data-theme="dark"] .af-acc, [data-theme="dark"] .tk-history-card,
[data-theme="dark"] .gv-steps-card, [data-theme="dark"] .mo-res-item {
    background: #221a12 !important; border-color: #3a2e22 !important; color: #e8ddd0 !important;
}
[data-theme="dark"] .dv-head, [data-theme="dark"] .up-head, [data-theme="dark"] .cp-head,
[data-theme="dark"] .ch-head, [data-theme="dark"] .gv-head, [data-theme="dark"] .ga-head,
[data-theme="dark"] .aa-head, [data-theme="dark"] .ac-head, [data-theme="dark"] .ad-head,
[data-theme="dark"] .mo-head, [data-theme="dark"] .sa-head { color: #ffffff !important; }

[data-theme="dark"] .dv-field, [data-theme="dark"] .cp-field, [data-theme="dark"] .ga-field input,
[data-theme="dark"] .ga-field textarea, [data-theme="dark"] .af-field, [data-theme="dark"] .aa-field input,
[data-theme="dark"] .ac-field, [data-theme="dark"] .mo-textarea, [data-theme="dark"] .sa-field input,
[data-theme="dark"] .tk-input, [data-theme="dark"] .up-search input, [data-theme="dark"] .aa-search input,
[data-theme="dark"] .sa-search input, [data-theme="dark"] .ch-note-input {
    background: #171109 !important; border-color: #3a2e22 !important; color: #f0e4d8 !important;
}
[data-theme="dark"] .dv-field[readonly], [data-theme="dark"] .cp-field[readonly],
[data-theme="dark"] .ac-field[readonly], [data-theme="dark"] .cp-field:disabled { color: #b6a390 !important; }
[data-theme="dark"] .dv-df-value, [data-theme="dark"] .up-empty, [data-theme="dark"] .aa-empty,
[data-theme="dark"] .sa-empty, [data-theme="dark"] .cp-ns { background: #171109 !important; border-color: #3a2e22 !important; color: #d8c4ac !important; }

[data-theme="dark"] .ad-table, [data-theme="dark"] .sd-table, [data-theme="dark"] .sa-table,
[data-theme="dark"] .aa-table { color: #e8ddd0 !important; }
[data-theme="dark"] .ad-key, [data-theme="dark"] .ad-val, [data-theme="dark"] .sd-tr,
[data-theme="dark"] .sa-table td, [data-theme="dark"] .aa-table td { background: transparent !important; border-color: #3a2e22 !important; color: #e8ddd0 !important; }
[data-theme="dark"] .sa-table th, [data-theme="dark"] .aa-table th { background: #2a2016 !important; color: #ffb37a !important; }
[data-theme="dark"] .ad-pre { background: #171109 !important; color: #ffb37a !important; }

[data-theme="dark"] .tk-msg-bubble { background: #221a12 !important; color: #e8ddd0 !important; }
[data-theme="dark"] .tk-msg-admin .tk-msg-bubble { background: #2a2016 !important; }

[data-theme="dark"] .dv-stat, [data-theme="dark"] .dv-dd-sel, [data-theme="dark"] .dv-dd-list,
[data-theme="dark"] .dv-results, [data-theme="dark"] .sd-lv-labels-top, [data-theme="dark"] .ch-pass-val,
[data-theme="dark"] .cp-pass-val, [data-theme="dark"] .tk-search-wrap, [data-theme="dark"] .up-results {
    background: #221a12 !important; border-color: #3a2e22 !important; color: #e8ddd0 !important;
}
[data-theme="dark"] .dv-opt:hover, [data-theme="dark"] .dv-opt.active { background: #2a2016 !important; }

[data-theme="dark"] .dv-hero, [data-theme="dark"] .up-hero, [data-theme="dark"] .cp-hero,
[data-theme="dark"] .gv-hero, [data-theme="dark"] .af-hero, [data-theme="dark"] .ac-hero,
[data-theme="dark"] .ad-hero, [data-theme="dark"] .mo-hero, [data-theme="dark"] .sd-hero,
[data-theme="dark"] .fq-hero, [data-theme="dark"] .tk-banner {
    box-shadow: 0 4px 18px rgba(0, 0, 0, .4) !important;
}