/* ===== MyShopRec Admin Panel ===== */
:root {
    --adm-primary: #667eea;
    --adm-primary-dark: #5a67d8;
    --adm-accent: #764ba2;
    --adm-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --adm-sidebar: #1e1b3a;
    --adm-sidebar-2: #2a2650;
    --adm-bg: #f4f5fb;
    --adm-card: #ffffff;
    --adm-border: #e6e8f0;
    --adm-text: #1f2333;
    --adm-muted: #6b7280;
    --adm-green: #10b981;
    --adm-green-bg: #ecfdf5;
    --adm-orange: #f59e0b;
    --adm-orange-bg: #fffbeb;
    --adm-red: #ef4444;
    --adm-red-bg: #fef2f2;
    --adm-blue: #3b82f6;
    --adm-blue-bg: #eff6ff;
    --adm-radius: 14px;
    --adm-shadow: 0 1px 3px rgba(20, 20, 50, .06), 0 6px 20px rgba(20, 20, 50, .05);
    --adm-sidebar-w: 250px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body.adm {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, Arial, sans-serif;
    background: var(--adm-bg);
    color: var(--adm-text);
    font-size: 15px;
    line-height: 1.5;
}
a { color: var(--adm-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Sidebar ---------- */
.adm-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--adm-sidebar-w);
    background: var(--adm-sidebar);
    color: #c9c6e8;
    display: flex; flex-direction: column;
    z-index: 100;
    transition: transform .25s ease;
}
.adm-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 22px 22px 18px;
    color: #fff; font-size: 19px; font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.adm-brand .logo {
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--adm-grad);
    display: grid; place-items: center; font-size: 17px;
}
.adm-brand small { display: block; font-size: 11px; font-weight: 600; color: #a5a1d6; letter-spacing: .12em; text-transform: uppercase; }
.adm-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.adm-nav .label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #7d78b3; padding: 14px 12px 6px; }
.adm-nav a, .adm-nav button {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 11px 14px; margin-bottom: 3px;
    border-radius: 10px; border: 0; background: none;
    color: #c9c6e8; font: inherit; font-size: 14.5px; text-align: left; cursor: pointer;
    transition: background .15s, color .15s;
}
.adm-nav a i, .adm-nav button i { width: 20px; text-align: center; font-size: 15px; }
.adm-nav a:hover, .adm-nav button:hover { background: var(--adm-sidebar-2); color: #fff; text-decoration: none; }
.adm-nav a.active { background: var(--adm-grad); color: #fff; box-shadow: 0 6px 16px rgba(102,126,234,.35); }
.adm-nav .badge-count { margin-left: auto; background: rgba(255,255,255,.15); color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 20px; }
.adm-nav form { margin: 0; }
.adm-nav .logout:hover { background: rgba(239,68,68,.15); color: #fca5a5; }
.adm-user {
    display: flex; align-items: center; gap: 10px;
    margin: 12px; padding: 12px; border-radius: 12px;
    background: var(--adm-sidebar-2); color: #fff; font-size: 14px;
}
.adm-user .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--adm-grad); display: grid; place-items: center; font-weight: 700; }
.adm-user small { display: block; color: #a5a1d6; font-size: 12px; }

/* ---------- Main ---------- */
.adm-main { margin-left: var(--adm-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.adm-topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 14px;
    padding: 14px 28px;
    background: rgba(255,255,255,.9); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--adm-border);
}
.adm-topbar h1 { font-size: 21px; font-weight: 700; }
.adm-topbar .sub { color: var(--adm-muted); font-size: 13px; }
.adm-topbar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--adm-muted); font-size: 14px; }
.adm-menu-btn { display: none; border: 0; background: none; font-size: 21px; color: var(--adm-text); cursor: pointer; padding: 4px 8px; }
.adm-content { padding: 26px 28px 40px; flex: 1; }
.adm-overlay { display: none; }

/* ---------- Cards & grid ---------- */
.adm-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.adm-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.adm-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.adm-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.adm-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.adm-grid.main-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mb { margin-bottom: 22px; }

.card {
    background: var(--adm-card); border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius); box-shadow: var(--adm-shadow);
}
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 16px 20px; border-bottom: 1px solid var(--adm-border);
}
.card-head h2 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h2 i { color: var(--adm-primary); }
.card-body { padding: 20px; }

.stat { padding: 20px; display: flex; gap: 16px; align-items: center; position: relative; overflow: hidden; }
.stat .icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 21px; flex: none; }
.stat .num { font-size: 27px; font-weight: 800; line-height: 1.1; }
.stat .lbl { color: var(--adm-muted); font-size: 13.5px; }
.stat a.more { position: absolute; inset: 0; }
.i-purple { background: #eef0ff; color: var(--adm-primary); }
.i-green { background: var(--adm-green-bg); color: var(--adm-green); }
.i-orange { background: var(--adm-orange-bg); color: var(--adm-orange); }
.i-red { background: var(--adm-red-bg); color: var(--adm-red); }
.i-blue { background: var(--adm-blue-bg); color: var(--adm-blue); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th {
    background: #f8f9fd; color: var(--adm-muted);
    font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
    padding: 12px 16px; text-align: left; white-space: nowrap;
}
.adm-table td { padding: 12px 16px; border-top: 1px solid var(--adm-border); vertical-align: middle; }
.adm-table tr:hover td { background: #fafbff; }
.adm-table .num { text-align: right; white-space: nowrap; }
.adm-table .nowrap { white-space: nowrap; }
.adm-table .strong { font-weight: 600; color: var(--adm-text); }
.adm-table .sub { display: block; font-size: 12.5px; color: var(--adm-muted); }
.empty { padding: 40px 20px; text-align: center; color: var(--adm-muted); }
.empty i { display: block; font-size: 32px; margin-bottom: 10px; color: #c7cadb; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.b-green { background: var(--adm-green-bg); color: #047857; }
.b-orange { background: var(--adm-orange-bg); color: #b45309; }
.b-red { background: var(--adm-red-bg); color: #b91c1c; }
.b-blue { background: var(--adm-blue-bg); color: #1d4ed8; }
.b-purple { background: #eef0ff; color: var(--adm-primary-dark); }
.b-gray { background: #f1f2f6; color: var(--adm-muted); }

/* ---------- Buttons & forms ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
    font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: transform .1s, box-shadow .15s, background .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--adm-grad); color: #fff; box-shadow: 0 4px 12px rgba(102,126,234,.3); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(102,126,234,.45); }
.btn-light { background: #fff; color: var(--adm-text); border-color: var(--adm-border); }
.btn-light:hover { background: #f6f7fb; }
.btn-green { background: var(--adm-green); color: #fff; }
.btn-danger { background: #fff; color: var(--adm-red); border-color: #fecaca; }
.btn-danger:hover { background: var(--adm-red-bg); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

.form-row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13.5px; font-weight: 600; color: #374151; }
.field .hint { font-size: 12.5px; color: var(--adm-muted); }
.input, .field input, .field select, .field textarea {
    width: 100%; padding: 10px 12px;
    border: 1.5px solid var(--adm-border); border-radius: 10px;
    font: inherit; font-size: 14.5px; background: #fff; color: var(--adm-text);
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .field input:focus, .field select:focus { outline: none; border-color: var(--adm-primary); box-shadow: 0 0 0 3px rgba(102,126,234,.18); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .search { position: relative; flex: 1 1 240px; }
.toolbar .search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--adm-muted); }
.toolbar .search input { padding-left: 36px; }
.toolbar select.input { width: auto; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 20px; font-size: 13.5px; font-weight: 600; color: var(--adm-muted); background: #f1f2f8; }
.tabs a.active, .tabs a:hover { background: var(--adm-grad); color: #fff; text-decoration: none; }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; margin-bottom: 20px; font-size: 14.5px; border: 1px solid transparent; }
.alert-success { background: var(--adm-green-bg); color: #065f46; border-color: #a7f3d0; }
.alert-error { background: var(--adm-red-bg); color: #991b1b; border-color: #fecaca; }
.alert-info { background: var(--adm-blue-bg); color: #1e40af; border-color: #bfdbfe; }

/* ---------- Misc ---------- */
.list { list-style: none; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--adm-border); font-size: 14px; }
.list li:first-child { border-top: 0; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 14.5px; }
.kv dt { color: var(--adm-muted); }
.kv dd { font-weight: 600; word-break: break-word; }
.code-chip {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: Consolas, 'Courier New', monospace; font-size: 14px; font-weight: 700; letter-spacing: .04em;
    background: #f4f5fb; border: 1px dashed #c7cbe6; padding: 5px 10px; border-radius: 8px;
}
.copy-btn { border: 0; background: none; color: var(--adm-primary); cursor: pointer; font-size: 13px; }
.progress { height: 8px; background: #eef0f6; border-radius: 10px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--adm-grad); border-radius: 10px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.danger-zone { border-color: #fecaca; }
.danger-zone .card-head h2 i { color: var(--adm-red); }
.text-muted { color: var(--adm-muted); }
.text-green { color: var(--adm-green); }
.text-red { color: var(--adm-red); }
.pagination { display: flex; gap: 6px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--adm-border); flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--adm-border); font-size: 13px; color: var(--adm-text); }
.pagination span.cur { background: var(--adm-grad); color: #fff; border-color: transparent; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .adm-grid.cols-4, .adm-grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .adm-grid.main-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
    .adm-sidebar { transform: translateX(-100%); }
    body.adm-open .adm-sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
    body.adm-open .adm-overlay { display: block; position: fixed; inset: 0; background: rgba(15,15,35,.45); z-index: 90; }
    .adm-main { margin-left: 0; }
    .adm-menu-btn { display: inline-block; }
    .adm-topbar { padding: 12px 16px; }
    .adm-topbar .right .hide-sm { display: none; }
    .adm-content { padding: 18px 14px 30px; }
    .adm-grid.cols-3, .adm-grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
    .adm-grid.cols-4, .adm-grid.cols-5 { grid-template-columns: minmax(0, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .kv { grid-template-columns: 1fr; gap: 2px 0; }
    .kv dd { margin-bottom: 8px; }
    .stat .num { font-size: 23px; }
    .adm-table th, .adm-table td { padding: 10px 12px; }
}

/* ---------- Support ticket conversation (shop + admin) ---------- */
.ticket-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; font-size: 13px; color: var(--adm-muted); }
.thread { display: flex; flex-direction: column; gap: 12px; max-height: 420px; overflow-y: auto; padding: 14px; background: #f7f8fc; border-radius: 12px; margin-bottom: 16px; }
.msg { max-width: 85%; padding: 11px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; word-break: break-word; }
.msg .body { white-space: pre-wrap; display: block; }
.msg .who-line { display: block; font-size: 12px; font-weight: 700; margin-bottom: 4px; opacity: .8; white-space: normal; }
.msg .when { display: block; font-size: 11.5px; margin-top: 6px; opacity: .65; white-space: normal; }
.msg.mine { align-self: flex-end; background: var(--adm-grad); color: #fff; border-bottom-right-radius: 4px; }
.msg.theirs { align-self: flex-start; background: #fff; border: 1px solid var(--adm-border); border-bottom-left-radius: 4px; }
.unread-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--adm-red); margin-left: 6px; vertical-align: middle; }
textarea.input, .field textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
tr.clickable { cursor: pointer; }

/* ---------- Live notifications (admin-live.js) ---------- */
#admToast { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.adm-toast { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; background: #1e1b3a; color: #fff;
    box-shadow: 0 12px 34px rgba(0,0,0,.28); font-size: 14px; line-height: 1.4; text-decoration: none !important;
    animation: toastIn .25s ease; transition: opacity .5s, transform .5s; border-left: 4px solid #818cf8; }
.adm-toast i { color: #a5b4fc; margin-top: 2px; }
.adm-toast small { color: #c7c4ee; }
a.adm-toast:hover { background: #2a2650; }
.adm-toast.out { opacity: 0; transform: translateX(20px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.msg-new { animation: toastIn .3s ease; }
@media (max-width: 560px) { #admToast { left: 14px; right: 14px; max-width: none; } }

/* ---------- Recharge history timeline (shop My Plan + admin shop page) ---------- */
.hist-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--adm-border); }
.hist-summary div { background: #f7f8fc; border-radius: 12px; padding: 12px 14px; }
.hist-summary b { display: block; font-size: 20px; font-weight: 800; }
.hist-summary span { font-size: 12.5px; color: var(--adm-muted); }
.timeline { list-style: none; padding: 20px 20px 8px; position: relative; }
.timeline li { position: relative; padding: 0 0 22px 52px; }
.timeline li::before { content: ""; position: absolute; left: 17px; top: 38px; bottom: 0; width: 2px; background: #e4e6f2; }
.timeline li:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; }
.tl-dot.renew { background: var(--adm-grad); color: #fff; box-shadow: 0 4px 12px rgba(102,126,234,.35); }
.tl-dot.admin { background: var(--adm-green-bg); color: var(--adm-green); }
.tl-dot.register { background: var(--adm-orange-bg); color: var(--adm-orange); }
.tl-dot.old { background: #eef0f6; color: var(--adm-muted); }
.tl-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.tl-title { font-weight: 700; font-size: 14.5px; }
.tl-when { font-size: 12.5px; color: var(--adm-muted); white-space: nowrap; }
.tl-box { margin-top: 8px; background: #fafbff; border: 1px solid var(--adm-border); border-radius: 12px; padding: 10px 14px;
          display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 13.5px; }
.tl-box .k { color: var(--adm-muted); margin-right: 4px; }
.tl-add { font-weight: 800; color: var(--adm-green); }
@media (max-width: 560px) { .hist-summary { grid-template-columns: 1fr 1fr; } .timeline li { padding-left: 46px; } }

/* Elements with the hidden attribute must never show (some classes set display:flex) */
[hidden] { display: none !important; }

/* ---------- Plans grid (My Plan) + reseller cards ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 20px; }
.plan-tile { position: relative; border: 1.5px solid var(--adm-border); border-radius: 14px; padding: 18px; background: #fff;
             display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.plan-tile:hover { border-color: #c7cbf5; box-shadow: 0 8px 22px rgba(102,126,234,.12); transform: translateY(-2px); }
.plan-tile .pt-name { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--adm-primary); }
.plan-tile .pt-len { font-size: 20px; font-weight: 800; }
.plan-tile .pt-price { font-size: 26px; font-weight: 800; margin-top: 4px; }
.plan-tile .pt-sub { font-size: 13px; color: var(--adm-muted); }
.plan-tile .pt-days { margin-top: auto; padding-top: 10px; font-size: 13px; color: var(--adm-muted); border-top: 1px dashed var(--adm-border); }
.plan-tile.current { border-color: var(--adm-primary); box-shadow: 0 0 0 3px rgba(102,126,234,.15); }
.plan-tile .pt-flag { position: absolute; top: 14px; right: 14px; }
.plan-tile.reseller { background: var(--adm-grad); color: #fff; border: 0; cursor: pointer; text-align: left; font: inherit; }
.plan-tile.reseller .pt-name, .plan-tile.reseller .pt-sub, .plan-tile.reseller .pt-days { color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.3); }
.plan-tile.reseller .pt-icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 20px; margin-bottom: 4px; }
.plan-tile.reseller:hover { box-shadow: 0 10px 26px rgba(118,75,162,.35); }
.reseller-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.reseller-card { border: 1px solid var(--adm-border); border-radius: 14px; padding: 16px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.rs-head { display: flex; gap: 12px; align-items: center; }
.rs-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--adm-grad); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.rs-city { display: block; font-size: 12.5px; color: var(--adm-muted); }
.rs-note { font-size: 13.5px; color: #4b5563; margin: 0; }
.rs-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.equal-row { align-items: stretch; }
.equal-row > .card { display: flex; flex-direction: column; }
@media (max-width: 1000px) { .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .plan-grid { grid-template-columns: minmax(0, 1fr); padding: 14px; } }

/* ---------- Notices (admin -> shop dashboard top) ---------- */
.notice-area { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.notice-area:empty { display: none; }
.notice-card { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 16px 48px 16px 16px;
               border-radius: 14px; border: 1px solid; border-left-width: 5px; box-shadow: var(--adm-shadow); animation: toastIn .3s ease; }
.notice-card .n-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 17px; flex: none; color: #fff; }
.notice-card .n-title { font-weight: 800; font-size: 15.5px; margin-bottom: 3px; }
.notice-card .n-msg { font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.notice-card .n-meta { font-size: 12px; opacity: .7; margin-top: 6px; }
.notice-card .n-close { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; border: 0;
                        background: rgba(0,0,0,.06); cursor: pointer; font-size: 15px; color: inherit; }
.notice-card .n-close:hover { background: rgba(0,0,0,.12); }
.notice-card.info    { background: linear-gradient(135deg, #eff6ff, #f5f8ff); border-color: #bfdbfe; border-left-color: #3b82f6; color: #1e3a8a; }
.notice-card.info .n-icon { background: #3b82f6; }
.notice-card.success { background: linear-gradient(135deg, #ecfdf5, #f3fdf8); border-color: #a7f3d0; border-left-color: #10b981; color: #065f46; }
.notice-card.success .n-icon { background: #10b981; }
.notice-card.warning { background: linear-gradient(135deg, #fffbeb, #fffdf4); border-color: #fde68a; border-left-color: #f59e0b; color: #78350f; }
.notice-card.warning .n-icon { background: #f59e0b; }
.notice-card.danger  { background: linear-gradient(135deg, #fef2f2, #fff6f6); border-color: #fecaca; border-left-color: #ef4444; color: #7f1d1d; }
.notice-card.danger .n-icon { background: #ef4444; }
.notice-card.out { opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s; }
.type-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.type-pick label { cursor: pointer; display: flex; }
.type-pick span { flex: 1; }
.type-pick span i { display: block; margin-bottom: 3px; }
.type-pick.two span i { display: inline; }
.n-acts { display: inline-grid; grid-template-columns: repeat(2, auto); gap: 6px; justify-content: end; }
.n-acts form { margin: 0; }
.type-pick input { display: none; }
.type-pick span { display: block; text-align: center; padding: 9px 6px; border-radius: 10px; border: 2px solid var(--adm-border); font-size: 13px; font-weight: 700; }
.type-pick input:checked + span { border-color: currentColor; box-shadow: 0 0 0 3px rgba(0,0,0,.05); }
.type-pick.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .type-pick { grid-template-columns: 1fr 1fr; } }

/* Admin settings: data protection card */
.dp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.dp-list li { position: relative; padding-left: 26px; line-height: 1.5; }
.dp-list li > i { position: absolute; left: 0; top: 4px; }
.dp-list code, .dp-key code { background: #f1f2f8; padding: 1px 6px; border-radius: 5px; font-size: 12.5px; word-break: break-all; }
.dp-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dp-stats > div { background: #f6f7fb; border-radius: 10px; padding: 10px; text-align: center; }
.dp-stats b { display: block; font-size: 22px; }
.dp-stats span { font-size: 12px; color: var(--adm-muted); }
.dp-stats .ok b { color: #10b981; }
.dp-stats .warn { background: #fff4e0; }
.dp-stats .warn b { color: #d97706; }
.dp-key { display: flex; gap: 12px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #fff8e6; border: 1px solid #f7dca0; font-size: 13px; }
.dp-key > i { color: #d97706; margin-top: 3px; }
.dp-key code { display: block; margin: 4px 0; }
.dp-key span { display: block; color: #6b5a2e; }
.dp-key.bad { background: #fdecec; border-color: #f5b5b5; }
@media (max-width: 560px) { .dp-stats { grid-template-columns: 1fr 1fr; } }

/* ================= Overview hero ================= */
.adm-hero {
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px;
    padding: 26px 28px; border-radius: 18px; color: #fff;
    background: radial-gradient(circle at 85% -20%, rgba(255,255,255,.22), transparent 45%),
                radial-gradient(circle at 10% 120%, rgba(255,255,255,.12), transparent 40%),
                linear-gradient(135deg, #5b5fe0 0%, #764ba2 60%, #9b4fb8 100%);
    box-shadow: 0 12px 30px rgba(102, 86, 200, .28);
}
.adm-hero::after {             /* soft dotted texture on the right */
    content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .18;
    background-image: radial-gradient(rgba(255,255,255,.7) 1px, transparent 1px); background-size: 18px 18px;
    mask-image: linear-gradient(90deg, transparent 40%, #000);
    -webkit-mask-image: linear-gradient(90deg, transparent 40%, #000);
}
.hero-main, .hero-side { position: relative; z-index: 1; }
.hero-hi { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.hero-hi .wave { display: inline-block; animation: wave 2.4s ease-in-out 1; transform-origin: 70% 70%; }
@keyframes wave { 0%,60%,100% { transform: rotate(0) } 10%,30% { transform: rotate(14deg) } 20% { transform: rotate(-8deg) } 40% { transform: rotate(-4deg) } 50% { transform: rotate(10deg) } }
.hero-sub { opacity: .85; font-size: 14px; margin-top: 2px; }
.hero-todo { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.hero-todo .todo {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 30px;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); color: #fff; font-size: 13.5px; font-weight: 600;
    backdrop-filter: blur(4px); transition: background .15s, transform .15s;
}
.hero-todo a.todo:hover { background: rgba(255,255,255,.26); text-decoration: none; transform: translateY(-1px); }
.hero-todo .todo.hot { background: #fff; color: #c2410c; border-color: #fff; }
.hero-todo .todo.hot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; animation: ping 1.6s infinite; }
.hero-todo .todo.warn i:first-child { color: #fde68a; }
.hero-todo .todo .go { font-size: 11px; opacity: .7; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.6) } 80%,100% { box-shadow: 0 0 0 8px rgba(239,68,68,0) } }
.hero-side { display: flex; flex-direction: column; gap: 14px; justify-content: space-between; }
.hero-money { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 14px; padding: 14px 18px; }
.hero-money span { display: block; font-size: 12.5px; opacity: .85; text-transform: uppercase; letter-spacing: .06em; }
.hero-money b { display: block; font-size: 30px; font-weight: 800; line-height: 1.2; }
.hero-money em { font-style: normal; font-size: 13px; opacity: .9; }
.hero-money em.up { color: #bbf7d0; }
.hero-money em.down { color: #fecaca; }
.hero-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hero-actions a, .hero-actions button {
    display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px;
    background: rgba(255,255,255,.95); color: #4c3fa8; font: inherit; font-size: 12px; font-weight: 700; border: 0; cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.hero-actions i { font-size: 17px; }
.hero-actions a:hover, .hero-actions button:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.18); }
@media (max-width: 900px) { .adm-hero { grid-template-columns: 1fr; padding: 22px; } .hero-hi { font-size: 22px; } }

/* ================= Bar chart (plan sales) ================= */
.chart-card { display: flex; flex-direction: column; }
.chart-card > .card-body { flex: 1; display: flex; flex-direction: column; }
.bar-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; height: 220px; flex: 1; min-height: 220px; align-items: end; padding-top: 28px; }
.bc-col { display: flex; flex-direction: column; align-items: stretch; height: 100%; justify-content: flex-end; }
.bc-bar {
    position: relative; min-height: 3px; border-radius: 8px 8px 3px 3px;
    background: linear-gradient(180deg, #a5b4fc, #818cf8); transition: filter .15s;
    transform-origin: bottom; animation: grow .7s cubic-bezier(.2,.8,.2,1) both;
}
.bc-col.now .bc-bar { background: var(--adm-grad); box-shadow: 0 6px 14px rgba(118,75,162,.3); }
.bc-bar[style*="height:0%"] { background: #eceef6; height: 3px !important; }
.bc-col:hover .bc-bar { filter: brightness(1.08); }
.bc-tip {
    position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%) translateY(4px);
    background: #1e1b3a; color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 700; white-space: nowrap;
    opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 2;
}
.bc-tip small { display: block; font-weight: 500; opacity: .75; font-size: 11px; }
.bc-col:hover .bc-tip { opacity: 1; transform: translateX(-50%) translateY(0); }
.bc-col:first-child .bc-tip { left: 0; transform: none; }
.bc-col:last-child .bc-tip { left: auto; right: 0; transform: none; }
.bc-lbl { text-align: center; font-size: 11.5px; color: var(--adm-muted); margin-top: 6px; }
.bc-col.now .bc-lbl { color: var(--adm-accent); font-weight: 800; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (max-width: 560px) { .bar-chart { gap: 4px; height: 180px; } .bc-lbl { font-size: 10px; } }

/* ================= Live activity feed ================= */
.feed { list-style: none; margin: 0; padding: 6px 18px 14px; }
.feed li { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.feed li:not(:last-child)::before { content: ''; position: absolute; left: 15px; top: 42px; bottom: -4px; width: 2px; background: var(--adm-border); }
.f-ic { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 13px; }
.f-purple { background: #f1ecfd; color: #7c3aed; }
.f-green { background: var(--adm-green-bg); color: var(--adm-green); }
.f-orange { background: var(--adm-orange-bg); color: var(--adm-orange); }
.f-blue { background: var(--adm-blue-bg); color: var(--adm-blue); }
.f-txt { font-size: 13.5px; line-height: 1.4; }
.f-time { font-size: 12px; color: var(--adm-muted); margin-top: 2px; }

/* ================= Ctrl+K quick search ================= */
.cmdk-btn {
    display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--adm-border); background: #f6f7fb; color: var(--adm-muted); font: inherit; font-size: 13.5px;
    transition: border-color .15s, box-shadow .15s;
}
.cmdk-btn:hover { border-color: var(--adm-primary); box-shadow: 0 0 0 3px rgba(102,126,234,.12); }
.adm-topbar .right { display: flex; align-items: center; gap: 14px; }
kbd { font: 700 11px/1 ui-monospace, Consolas, monospace; background: #fff; border: 1px solid var(--adm-border); border-bottom-width: 2px; border-radius: 5px; padding: 3px 5px; color: var(--adm-muted); }
.cmdk { position: fixed; inset: 0; z-index: 400; background: rgba(20, 18, 40, .45); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.cmdk[hidden] { display: none !important; }
body.cmdk-on { overflow: hidden; }
.cmdk-box { width: 100%; max-width: 620px; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(20,18,40,.35); overflow: hidden; animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(-8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--adm-border); }
.cmdk-input i { color: var(--adm-primary); }
.cmdk-input input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 16.5px; background: transparent; color: var(--adm-text); }
.cmdk-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.cmdk-group { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--adm-muted); padding: 10px 12px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--adm-text); }
.cmdk-item:hover { text-decoration: none; }
.cmdk-item.hl { background: #eef0ff; }
.cmdk-item > i { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #f1f2f8; color: var(--adm-primary); flex: none; }
.cmdk-item.hl > i { background: var(--adm-grad); color: #fff; }
.cmdk-item > span:not(.badge) { flex: 1; min-width: 0; }
.cmdk-item > .badge { flex: none; }
.cmdk-item b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item small { display: block; color: var(--adm-muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-empty { padding: 28px; text-align: center; color: var(--adm-muted); }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--adm-border); background: #fafbfe; font-size: 12px; color: var(--adm-muted); }
.cmdk-foot kbd { margin-right: 3px; }
@media (max-width: 560px) { .cmdk { padding-top: 8vh; } .cmdk-foot { display: none; } }

/* Phone: stat cards 2 per row, compact (page stays short) */
@media (max-width: 560px) {
    .adm-grid.cols-4:has(> .stat) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .adm-grid.cols-4 > .stat { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
    .adm-grid.cols-4 > .stat .icon { width: 40px; height: 40px; font-size: 16px; border-radius: 11px; }
    .adm-grid.cols-4 > .stat .lbl { font-size: 12.5px; }
}

/* =====================================================================
   Pro look v2: sidebar, avatars, plan chips, profile header, codes
   ===================================================================== */

/* ---------- Sidebar ---------- */
.adm-sidebar {
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(118,75,162,.35), transparent 60%),
        linear-gradient(180deg, #1f1c3d 0%, #18152f 100%);
    border-right: 1px solid rgba(255,255,255,.04);
    transition: transform .25s ease, width .2s ease;
}
.adm-brand { position: relative; padding: 20px 18px 18px 20px; }
.adm-brand .logo { box-shadow: 0 6px 16px rgba(118,75,162,.45); flex: none; }
.brand-txt { flex: 1; min-width: 0; white-space: nowrap; }
.mini-btn {
    flex: none; width: 28px; height: 28px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.04); color: #a5a1d6; cursor: pointer; font-size: 12px; transition: background .15s, color .15s, transform .2s;
}
.mini-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.adm-nav { padding: 8px 12px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.adm-nav .label { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; color: #6f6aa6; padding: 16px 12px 6px; }
.adm-nav a { position: relative; padding: 10px 12px; font-size: 14px; color: #bdb9e0; }
.adm-nav a i { color: #8e89c4; transition: color .15s; }
.adm-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.adm-nav a:hover i { color: #fff; }
.adm-nav a.active {
    background: linear-gradient(90deg, rgba(129,140,248,.22), rgba(118,75,162,.12));
    color: #fff; box-shadow: inset 0 0 0 1px rgba(165,180,252,.18);
}
.adm-nav a.active::before {
    content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, #a5b4fc, #c084fc); box-shadow: 0 0 12px rgba(165,180,252,.8);
}
.adm-nav a.active i { color: #c7d2fe; }
.nav-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-count { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 20px; background: rgba(255,255,255,.08); color: #bdb9e0; }
.nav-count.warn { background: rgba(245,158,11,.2); color: #fcd34d; }
.nav-count.live { background: rgba(16,185,129,.18); color: #6ee7b7; }
.adm-nav .badge-count { background: #ef4444; font-weight: 700; box-shadow: 0 0 0 3px rgba(239,68,68,.2); }
.adm-nav .ext { width: auto !important; font-size: 10px !important; margin-left: auto; opacity: .5; }
.adm-user { margin: 10px 12px 14px; padding: 10px 10px 10px 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.06); }
.adm-user .avatar { position: relative; flex: none; }
.adm-user .online { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; border: 2px solid #1b1834; }
.user-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.user-txt small { overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.user-out { margin: 0; }
.adm-user .logout-btn {
    width: 34px; height: 34px; border-radius: 9px; border: 0; cursor: pointer; font-size: 14px;
    background: rgba(255,255,255,.06); color: #bdb9e0; transition: background .15s, color .15s;
}
.adm-user .logout-btn:hover { background: rgba(239,68,68,.2); color: #fca5a5; }

/* Collapsed (icons only) - desktop */
@media (min-width: 861px) {
    html.adm-mini { --adm-sidebar-w: 78px; }
    html.adm-mini .brand-txt, html.adm-mini .nav-txt, html.adm-mini .nav-count, html.adm-mini .adm-nav .ext,
    html.adm-mini .user-txt, html.adm-mini .adm-nav .label { display: none; }
    html.adm-mini .adm-brand { flex-direction: column; padding: 18px 10px 14px; gap: 10px; }
    html.adm-mini .mini-btn { transform: rotate(180deg); }
    html.adm-mini .adm-nav { padding: 10px; }
    html.adm-mini .adm-nav a { justify-content: center; padding: 12px 0; }
    html.adm-mini .adm-nav a.active::before { left: -10px; }
    html.adm-mini .adm-nav .badge-count { position: absolute; top: 4px; right: 6px; padding: 0 5px; font-size: 10px; }
    html.adm-mini .adm-nav a::after {             /* tooltip */
        content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
        background: #111027; color: #fff; font-size: 12.5px; font-weight: 600; padding: 6px 10px; border-radius: 8px; white-space: nowrap;
        opacity: 0; pointer-events: none; transition: opacity .12s; box-shadow: 0 6px 16px rgba(0,0,0,.3);
    }
    html.adm-mini .adm-nav a:hover::after { opacity: 1; }
    html.adm-mini .adm-nav { overflow: visible; }
    html.adm-mini .adm-user { flex-direction: column; padding: 10px 6px; }
}
@media (max-width: 860px) { .mini-btn { display: none; } }

/* ---------- Avatars ---------- */
.av {
    flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
    font-size: 13px; font-weight: 800; letter-spacing: .02em; color: #fff; text-transform: uppercase;
}
.av-sm { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
.av-lg { width: 64px; height: 64px; border-radius: 18px; font-size: 24px; box-shadow: 0 8px 20px rgba(20,20,50,.15); }
.av-0 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.av-1 { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.av-2 { background: linear-gradient(135deg, #10b981, #059669); }
.av-3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.av-4 { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.av-5 { background: linear-gradient(135deg, #14b8a6, #0ea5e9); }
.av-6 { background: linear-gradient(135deg, #f97316, #f59e0b); }
.av-7 { background: linear-gradient(135deg, #64748b, #334155); }
.who-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.who-cell > div { min-width: 0; }

/* ---------- Plan chips (one colour per plan) ---------- */
.plan-chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid transparent;
}
.plan-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pc-basic   { background: #eff6ff; color: #2563eb; border-color: #dbeafe; }
.pc-advance { background: #ecfeff; color: #0891b2; border-color: #cffafe; }
.pc-pro     { background: #f5f3ff; color: #7c3aed; border-color: #ede9fe; }
.pc-golden  { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.pc-diamond { background: #fdf2f8; color: #db2777; border-color: #fbcfe8; }
.pc-other   { background: #f1f5f9; color: #475569; }

/* ---------- Days-left mini bar ---------- */
.days-bar { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.days-bar b { min-width: 22px; text-align: right; }
.db-track { width: 54px; height: 6px; border-radius: 6px; background: #eef0f6; overflow: hidden; }
.db-fill { display: block; height: 100%; border-radius: 6px; }
.db-green { background: linear-gradient(90deg, #34d399, #10b981); }
.db-orange { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.db-red { background: #fca5a5; }

/* ---------- Tables: nicer hover ---------- */
.adm-table tbody tr { transition: background .12s; }
.adm-table tbody tr:hover td { background: #fafaff; }

/* ---------- Shop profile header ---------- */
.profile-head {
    display: flex; align-items: center; gap: 18px; padding: 20px 22px; position: relative; overflow: hidden;
    background: linear-gradient(120deg, #ffffff 55%, #f5f3ff 100%);
}
.profile-head::after { content: ''; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(139,92,246,.12), transparent 70%); pointer-events: none; }
.ph-back { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--adm-border); color: var(--adm-text); }
.ph-back:hover { background: #f4f5fb; text-decoration: none; }
.ph-main { flex: 1; min-width: 0; }
.ph-name { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ph-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; font-size: 13.5px; color: var(--adm-muted); align-items: center; }
.ph-meta i { margin-right: 4px; opacity: .7; }
.ph-actions { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
@media (max-width: 860px) { .profile-head { flex-wrap: wrap; gap: 14px; padding: 16px; } .profile-head .av-lg { width: 48px; height: 48px; font-size: 18px; border-radius: 14px; } .ph-main { flex-basis: calc(100% - 120px); } .ph-actions { width: 100%; } .ph-name { font-size: 19px; } }

/* ---------- Code stock cards (plan colours) ---------- */
.code-stock { transition: transform .15s, box-shadow .15s; }
.code-stock:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20,20,50,.08); }
.code-stock.on { outline: 2px solid var(--adm-primary); outline-offset: -2px; }
.code-stock .icon { color: #fff; }
.cs-basic .icon   { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.cs-advance .icon { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.cs-pro .icon     { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.cs-golden .icon  { background: linear-gradient(135deg, #fcd34d, #d97706); }
.cs-diamond .icon { background: linear-gradient(135deg, #f9a8d4, #db2777); }
.cs-flag { position: absolute; top: 10px; right: 10px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 20px; }
.cs-flag.out { background: var(--adm-red-bg); color: var(--adm-red); }
.cs-flag.low { background: var(--adm-orange-bg); color: #b45309; }

/* list rows with a plan chip on the left */
.list li .plan-chip { font-size: 12.5px; }

/* =====================================================================
   Reseller credit system (admin pages + reseller portal)
   ===================================================================== */
.hint { font-size: 12.5px; color: var(--adm-muted); }
.muted-note { font-size: 13px; color: var(--adm-muted); }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Admin: common price per plan */
.price-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 12px; align-items: stretch; }
.price-cell { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--adm-border); background: #fbfbfe; }
.pc-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.pc-top small, .pc-note { color: var(--adm-muted); font-size: 11.5px; }
.pc-input { display: flex; align-items: center; border: 1.5px solid var(--adm-border); border-radius: 10px; background: #fff; overflow: hidden; }
.pc-input i { font-style: normal; padding: 0 0 0 10px; color: var(--adm-muted); font-weight: 700; }
.pc-input input { border: 0 !important; box-shadow: none !important; padding: 8px 10px 8px 6px; font-size: 16px; font-weight: 700; width: 100%; min-width: 0; background: transparent; }
.price-save { display: flex; flex-direction: column; justify-content: center; gap: 6px; align-items: flex-start; }
.pcell-basic { border-top: 3px solid #3b82f6; } .pcell-advance { border-top: 3px solid #06b6d4; } .pcell-pro { border-top: 3px solid #8b5cf6; }
.pcell-golden { border-top: 3px solid #f59e0b; } .pcell-diamond { border-top: 3px solid #ec4899; }
@media (max-width: 1100px) { .price-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .price-save { grid-column: 1 / -1; } }

/* Admin: special price rows */
.sp-row { display: grid; grid-template-columns: 100px 1fr auto; gap: 10px; align-items: center; margin-bottom: 8px; }
.sp-row input { padding: 8px 10px; }
.sp-now { font-size: 12px; color: var(--adm-muted); white-space: nowrap; }

/* Portal: balance pill in the top bar */
.rs-balance { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 30px; background: var(--adm-green-bg); color: #047857; font-weight: 800; font-size: 15px; border: 1px solid #a7f3d0; }
.rs-meter { height: 8px; border-radius: 8px; background: rgba(255,255,255,.2); overflow: hidden; }
.rs-meter span { display: block; height: 100%; background: linear-gradient(90deg, #fde68a, #fff); border-radius: 8px; }
.rs-new { border-color: #a7f3d0; box-shadow: 0 0 0 4px rgba(16,185,129,.08), var(--adm-shadow); }

/* Portal: plan picker */
.rs-plans { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.rs-plan { cursor: pointer; }
.rs-plan input { position: absolute; opacity: 0; pointer-events: none; }
.rs-plan-box { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px; border-radius: 14px; border: 2px solid var(--adm-border); background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s; }
.rs-plan:hover .rs-plan-box { transform: translateY(-2px); }
.rs-plan input:checked + .rs-plan-box { border-color: var(--adm-primary); box-shadow: 0 0 0 4px rgba(102,126,234,.15); }
.rs-plan input:focus-visible + .rs-plan-box { outline: 2px solid var(--adm-primary); }
.rs-plan-box b { font-size: 22px; font-weight: 800; margin-top: 6px; }
.rp-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.rp-top small, .rp-sub { font-size: 11.5px; color: var(--adm-muted); }
.rp-stock { font-size: 11.5px; color: var(--adm-muted); margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--adm-border); }
.rs-plan.off { cursor: not-allowed; opacity: .55; }
.rs-plan.off .rs-plan-box b { font-size: 14px; color: var(--adm-muted); }
.rs-buy-row { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--adm-border); }
.rs-qty { display: flex; align-items: center; border: 1.5px solid var(--adm-border); border-radius: 10px; overflow: hidden; }
.rs-qty button { width: 40px; height: 42px; border: 0; background: #f4f5fb; font-size: 18px; font-weight: 700; cursor: pointer; color: var(--adm-text); }
.rs-qty button:hover { background: #e9ebf7; }
.rs-qty input { width: 70px; text-align: center; border: 0 !important; box-shadow: none !important; font-size: 16px; font-weight: 700; }
.rs-sum { display: flex; gap: 22px; flex: 1; }
.rs-sum span { display: block; font-size: 12px; color: var(--adm-muted); text-transform: uppercase; letter-spacing: .05em; }
.rs-sum b { font-size: 20px; font-weight: 800; }
@media (max-width: 1100px) { .rs-plans { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .rs-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rs-buy-row .btn { width: 100%; } }

/* Portal: login page */
body.rs-auth { background: #f4f5fb; }
body.rs-auth a:hover { text-decoration: none; }
.rs-auth-main { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 48px 16px;
    background: radial-gradient(80% 60% at 0% 0%, rgba(118,75,162,.25), transparent 60%), radial-gradient(70% 60% at 100% 100%, rgba(102,126,234,.25), transparent 60%), #f4f5fb; }
.rs-auth-wrap { width: 100%; max-width: 960px; display: grid; grid-template-columns: 1.1fr 1fr; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 70px rgba(30,27,58,.18); background: #fff; }
.rs-auth-side { padding: 40px; color: #fff; background: radial-gradient(circle at 90% 0%, rgba(255,255,255,.2), transparent 45%), linear-gradient(150deg, #1f1c3d, #4c3fa8 70%, #764ba2); display: flex; flex-direction: column; gap: 24px; }
.rs-auth-side h1 { font-size: 30px; line-height: 1.2; font-weight: 800; margin-top: 30px; }
.rs-auth-side ul { list-style: none; display: grid; gap: 12px; margin-top: auto; }
.rs-auth-side li { display: flex; gap: 12px; align-items: center; opacity: .92; font-size: 14.5px; }
.rs-auth-side li i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.14); flex: none; }
.rs-auth-card { border: 0; box-shadow: none; border-radius: 0; padding: 40px; }
.rs-auth-card h2 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
@media (max-width: 760px) { .rs-auth-wrap { grid-template-columns: 1fr; } .rs-auth-side { padding: 26px; } .rs-auth-side h1 { font-size: 22px; margin-top: 10px; } .rs-auth-side ul { display: none; } .rs-auth-card { padding: 26px; } }
.sp-row { grid-template-columns: 92px minmax(0, 1fr); }
.sp-row input { width: 100%; min-width: 0; }
.sp-row .sp-now { grid-column: 2; margin-top: -4px; }
.adm-table .sub.nowrap div { display: inline-block; margin-right: 10px; }
@media (max-width: 1300px) { .hide-md { display: none; } }
.adm-table td.stack .badge { display: table; margin: 2px 0; white-space: nowrap; }

/* Resellers: add form + recharge pop-up */
.check-line { display: flex; gap: 8px; align-items: center; margin: 4px 0 12px; font-size: 14px; }
.pw-wrap { display: flex; gap: 8px; }
.pw-wrap input { flex: 1; min-width: 0; }
.more-box { border: 1px dashed var(--adm-border); border-radius: 12px; padding: 10px 14px; background: #fbfbfe; }
.more-box summary { cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; }
.more-box summary::-webkit-details-marker { display: none; }
.more-box summary::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; float: right; font-size: 11px; color: var(--adm-muted); transition: transform .2s; }
.more-box[open] summary::after { transform: rotate(180deg); }
.more-box[open] summary { margin-bottom: 12px; }
.rc-btn { margin-top: 6px; }
.adm-dialog { margin: auto; border: 0; padding: 0; border-radius: 18px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 30px 70px rgba(20,18,40,.35); }
.adm-dialog::backdrop { background: rgba(20,18,40,.45); backdrop-filter: blur(3px); }
.adm-dialog[open] { animation: pop .16s ease-out; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--adm-border); }
.dlg-head h3 { font-size: 17px; }
.dlg-x { border: 0; background: #f1f2f8; width: 32px; height: 32px; border-radius: 50%; font-size: 20px; cursor: pointer; line-height: 1; }
.dlg-body { padding: 18px 20px 4px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }
.rc-who { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #f6f7fb; margin-bottom: 14px; font-size: 14px; }
.rc-who span { color: var(--adm-muted); font-size: 13px; }
.rc-who span b { color: #059669; }
.rc-amount input { font-size: 22px !important; }
.rc-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rc-quick button { border: 1px solid var(--adm-border); background: #fff; border-radius: 20px; padding: 4px 12px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--adm-primary); }
.rc-quick button:hover { border-color: var(--adm-primary); background: #eef0ff; }
.mt { margin-top: 20px; }
.tf-codes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; font-family: Consolas, monospace; font-size: 16px; font-weight: 700; text-align: center; }
.tf-codes div { background: #fff; border-radius: 8px; padding: 8px; }
.tf-qr { display: inline-block; padding: 12px; background: #fff; border: 1px solid var(--adm-border); border-radius: 12px; }
@media (max-width: 560px) { .tf-codes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Reseller groups */
.grp-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.grp-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 30px; border: 1.5px solid var(--adm-border); background: #fff; color: var(--adm-text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.grp-chip:hover { text-decoration: none; border-color: var(--adm-primary); }
.grp-chip span { background: #f1f2f8; color: var(--adm-muted); font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 20px; }
.grp-chip .fa-star { color: #f59e0b; font-size: 12px; }
.grp-chip.on { background: var(--adm-grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(102,126,234,.3); }
.grp-chip.on span { background: rgba(255,255,255,.25); color: #fff; }
.grp-chip.on .fa-star { color: #fde68a; }
.grp-chip.add { border-style: dashed; color: var(--adm-primary); }
.grp-new { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; padding: 12px; border-radius: 12px; background: #f6f7fb; }
.grp-new input { flex: 1 1 240px; }
.grp-new[hidden] { display: none !important; }
.grp-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--adm-border); }
.grp-rename { display: flex; gap: 8px; align-items: center; }
.grp-rename input { width: 220px; padding: 7px 10px; font-weight: 700; }
.grp-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 20px; background: #fff7ed; color: #c2410c; font-size: 11px; font-weight: 700; border: 1px solid #fed7aa; vertical-align: middle; }
.grp-tag.big { font-size: 12.5px; padding: 3px 10px; margin-left: 0; }
.rs-group { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 2px; padding: 4px 12px; border-radius: 30px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); font-size: 13px; font-weight: 700; }
.rs-group i { color: #fde68a; }
@media (max-width: 560px) { .grp-rename input { width: 150px; } }

/* =====================================================================
   Reseller cards (public Resellers page + shop My Plan pop-up) - step 15
   ===================================================================== */
.rl-tabs { position: sticky; top: 70px; z-index: 5; display: flex; gap: 8px; flex-wrap: wrap; padding: 10px; margin: 0 0 26px;
    background: rgba(246,247,251,.9); backdrop-filter: blur(8px); border: 1px solid #e6e8f0; border-radius: 16px; }
.rl-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 12px; border: 0; background: transparent;
    font: inherit; font-size: 14.5px; font-weight: 700; color: #4b5068; cursor: pointer; transition: background .15s, color .15s; }
.rl-tabs button span { background: #e9ebf5; color: #6b7280; font-size: 11.5px; padding: 1px 8px; border-radius: 20px; }
.rl-tabs button:hover { background: #fff; }
.rl-tabs button.on { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; box-shadow: 0 8px 18px rgba(102,126,234,.3); }
.rl-tabs button.on span { background: rgba(255,255,255,.25); color: #fff; }
.rl-section { margin-bottom: 34px; }
.rl-section[hidden] { display: none !important; }
.rl-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.rl-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: #fff; border: 1px solid #e6e8f0; box-shadow: 0 4px 12px rgba(20,20,50,.05); }
.rl-head h2 { font-size: 19px; font-weight: 800; margin: 0; }
.rl-head p { margin: 2px 0 0; color: #6b7280; font-size: 13.5px; }
.rl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.rl-card { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid #e6e8f0; border-radius: 16px; padding: 16px;
    box-shadow: 0 1px 3px rgba(20,20,50,.04); transition: transform .15s, box-shadow .15s, border-color .15s; }
.rl-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(20,20,50,.08); border-color: #d5d9f5; }
.rl-badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 800;
    background: #fff7e0; color: #92400e; border: 1px solid #fde68a; }
.rl-body { display: flex; gap: 10px; align-items: flex-start; flex: 1; }
.rl-info { flex: 1; min-width: 0; }
.rl-info h3 { font-size: 16px; font-weight: 800; margin: 0; word-break: break-word; }
.rl-region { font-size: 12.5px; color: #9aa0b4; margin-top: 2px; }
.rl-links { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 5px; font-size: 13px; }
.rl-links li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rl-links i { width: 16px; text-align: center; color: #667eea; }
.rl-links i.rl-wa { color: #16a34a; } .rl-links i.rl-tg { color: #0ea5e9; }
.rl-links a { color: #4b5068; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-links a:hover { color: #667eea; }
.rl-logo { flex: none; width: 72px; height: 72px; border-radius: 14px; display: grid; place-items: center; overflow: hidden; background: #f7f8fc; border: 1px solid #eef0f6; }
.rl-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.rl-ini { font-size: 22px; font-weight: 800; color: #fff; width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, #667eea, #764ba2); }
.rl-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border-radius: 11px; font-weight: 700; font-size: 14px; color: #fff !important;
    background: linear-gradient(135deg, #5b7cfa, #667eea); box-shadow: 0 6px 14px rgba(91,124,250,.3); transition: filter .15s; }
.rl-btn:hover { filter: brightness(1.08); text-decoration: none; }
.rl-btn i { font-size: 12px; transition: transform .15s; }
.rl-btn:hover i { transform: translateX(3px); }
@media (max-width: 1100px) { .rl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .rl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .rl-grid { grid-template-columns: minmax(0, 1fr); } .rl-tabs { top: 60px; } }
/* smaller grid inside the shop My Plan pop-up */
.modal .rl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) { .modal .rl-grid { grid-template-columns: minmax(0, 1fr); } }

/* Admin: listing form */
.lst-form { background: #f8f9fd; border: 1px solid var(--adm-border); border-radius: 14px; padding: 16px; align-self: start; }
.lst-form h3 { font-size: 16px; margin-bottom: 12px; }
.lst-logo { width: 36px; height: 36px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--adm-border); flex: none; }
.lst-links a { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #f1f2f8; margin-right: 4px; }
.lst-upload { display: flex; align-items: center; gap: 12px; }
.lst-upload input { flex: 1; min-width: 0; }
.lst-prev { flex: none; width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: #fff; border: 1px dashed var(--adm-border); color: var(--adm-muted); }
.lst-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.row-off td { opacity: .55; }
.grp-icon { width: 54px !important; text-align: center; font-size: 18px; }
.grp-tagline { width: 320px; }
@media (max-width: 900px) { .grp-tagline { width: 100%; } .grp-rename { flex-wrap: wrap; } }
.grp-pos { width: 70px !important; text-align: center; }
.rs-page[hidden] { display: none !important; }
.n-close-form { margin: 0; }
.type-pick .tp-in { font-weight: inherit; }

/* Reseller portal: ticket list */
.tk-list { list-style: none; margin: 0; padding: 6px; }
.tk-list li a { display: block; padding: 11px 12px; border-radius: 10px; color: var(--adm-text); }
.tk-list li a:hover { background: #f6f7fb; text-decoration: none; }
.tk-list li.on a { background: #eef0ff; box-shadow: inset 3px 0 0 var(--adm-primary); }
.tk-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tk-top b { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.2); }
.tk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; color: var(--adm-muted); }
