:root {
  --ink: #17263d;
  --ink-soft: #526278;
  --muted: #8b98a9;
  --line: #dfe5ec;
  --panel: #ffffff;
  --canvas: #f2f5f8;
  --nav: #f7f9fb;
  --accent: #d9343b;
  --accent-dark: #b8202b;
  --accent-pale: #fff0f1;
  --teal: #078f9d;
  --blue: #2877d4;
  --green: #21885d;
  --amber: #bd7610;
  --shadow: 0 10px 28px rgba(26, 46, 75, .08);
  --radius: 7px;
  --font: Inter, "Noto Sans SC", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); scroll-behavior: auto; overflow-anchor: none; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: var(--font); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(40, 119, 212, .32); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Login */
.login-view { min-height: 100vh; display: grid; place-items: center; position: relative; overflow: hidden; background: #e9edf2; }
.login-backdrop { position: absolute; inset: 0; background: linear-gradient(135deg, #d7dfe8 0%, #eef2f5 48%, #d9e4e8 100%); }
.login-backdrop::before, .login-backdrop::after { content: ""; position: absolute; border: 1px solid rgba(23, 38, 61, .08); transform: rotate(-14deg); }
.login-backdrop::before { width: 80vw; height: 36vw; top: 8%; left: -15%; }
.login-backdrop::after { width: 78vw; height: 40vw; bottom: -12%; right: -18%; }
.login-panel { position: relative; width: min(470px, calc(100% - 32px)); margin: 28px 0; padding: 34px 38px 25px; background: rgba(255, 255, 255, .95); border: 1px solid rgba(255,255,255,.75); border-radius: 10px; box-shadow: 0 24px 60px rgba(22, 43, 68, .2); }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand img { width: 48px; height: 48px; object-fit: cover; border-radius: 50%; background: #fff; }
.login-brand strong { display: block; color: var(--accent); font-size: 21px; letter-spacing: .02em; }
.login-brand span { display: block; color: var(--ink-soft); font-size: 12px; margin-top: 1px; }
.login-copy { margin: 34px 0 22px; }
.eyebrow { margin: 0 0 8px; color: var(--teal); font-size: 11px; letter-spacing: .17em; font-weight: 700; }
.login-copy h1 { margin: 0; color: var(--ink); font-size: 30px; font-weight: 750; letter-spacing: .01em; }
.login-copy p:last-child { margin: 8px 0 0; color: var(--ink-soft); }
.auth-switch { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.auth-tab { position: relative; padding: 0 0 10px; background: transparent; color: var(--muted); font-weight: 650; }
.auth-tab.is-active { color: var(--accent); }
.auth-tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.auth-form { display: grid; gap: 16px; }
.auth-form > label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 13px; font-weight: 600; }
.auth-form input { width: 100%; height: 44px; padding: 0 13px; border: 1px solid #d5dce5; border-radius: 5px; color: var(--ink); background: #fbfcfe; transition: border .18s, box-shadow .18s; }
.auth-form input::placeholder { color: #aab4c0; }
.auth-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(40,119,212,.1); outline: none; }
.password-field { position: relative; }
.password-field input { padding-right: 44px; }
.password-field .icon-button { position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; color: var(--muted); background: transparent; }
.form-meta { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 12px; }
.form-meta a { color: var(--blue); }
.check-label { display: inline-flex; gap: 7px; align-items: center; font-weight: 500; }
.check-label input { width: 14px; height: 14px; accent-color: var(--accent); }
.primary-button { min-height: 44px; display: inline-flex; justify-content: center; align-items: center; gap: 12px; border-radius: 5px; background: var(--accent); color: white; font-weight: 700; box-shadow: 0 7px 14px rgba(217,52,59,.2); transition: background .18s, transform .18s; }
.primary-button:hover { background: var(--accent-dark); transform: translateY(-1px); }
.auth-submit { margin-top: 2px; }
.auth-submit b { font-size: 19px; font-weight: 500; }
.demo-hint { margin: -2px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.demo-hint code { color: var(--ink-soft); background: #f0f3f6; padding: 2px 5px; border-radius: 3px; }
.login-foot { margin: 28px 0 0; color: var(--muted); text-align: center; font-size: 11px; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin: 0 3px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(33,136,93,.1); }

/* App chrome */
.console-view { height: 100vh; min-height: 520px; display: flex; flex-direction: column; overflow: hidden; }
.topbar { position: sticky; top: 0; z-index: 30; height: 76px; flex: 0 0 76px; display: grid; grid-template-columns: 250px 1fr 330px; align-items: center; padding: 0 28px; color: var(--ink); border-bottom: 1px solid #cfd7e0; background: #e6eaee; box-shadow: 0 2px 8px rgba(32,50,74,.09); }
.topbar::after { content: ""; pointer-events: none; position: absolute; inset: 0; opacity: .18; background: repeating-linear-gradient(165deg, transparent 0 26px, rgba(255,255,255,.8) 27px 29px, transparent 30px 56px); }
.topbar > * { position: relative; z-index: 1; }
.topbar-brand { display: flex; align-items: center; min-width: 0; }
.brand-lockup { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #fff; box-shadow: 0 2px 7px rgba(22,42,67,.12); }
.brand-mark img { width: 53px; height: 53px; object-fit: cover; }
.brand-words { display: grid; line-height: 1.05; }
.brand-words strong { color: var(--accent); font-size: 22px; letter-spacing: .03em; }
.brand-words strong span { color: #ee1e25; }
.brand-words small { margin-top: 3px; color: #26354b; font-size: 11px; letter-spacing: .07em; }
.topbar-slogan { justify-self: center; color: #fff; font-size: clamp(22px, 2.35vw, 34px); font-weight: 500; letter-spacing: .08em; text-shadow: 0 1px 2px rgba(20,34,53,.2); white-space: nowrap; }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 12px; }
.top-action { width: 48px; height: 48px; position: relative; display: grid; place-items: center; border-radius: 6px; color: #fff; background: var(--accent); box-shadow: 0 4px 9px rgba(180,28,40,.15); transition: transform .15s, background .15s; }
.top-action:hover { background: var(--accent-dark); transform: translateY(-1px); }
.top-icon { font-size: 25px; line-height: 1; }
.top-action i { position: absolute; right: -4px; top: -5px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; color: white; background: var(--teal); border: 2px solid #e6eaee; border-radius: 9px; font-size: 10px; font-style: normal; }
.user-menu-wrap { position: relative; margin-left: 2px; }
.user-menu { height: 48px; display: inline-flex; align-items: center; gap: 8px; padding: 0 5px 0 3px; color: var(--ink); background: transparent; font-weight: 650; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; color: white; border-radius: 50%; background: var(--teal); font-size: 14px; font-weight: 750; }
.chevron { color: var(--ink-soft); font-size: 18px; line-height: 1; }
.user-dropdown { position: absolute; top: 54px; right: 0; z-index: 40; width: 150px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: var(--shadow); }
.user-dropdown a, .user-dropdown button { display: block; width: 100%; padding: 9px 10px; color: var(--ink-soft); text-align: left; border-radius: 4px; background: transparent; font-size: 13px; }
.user-dropdown a:hover, .user-dropdown button:hover { color: var(--accent); background: var(--accent-pale); }
.mobile-menu { display: none; }

.layout-body { display: flex; flex: 1; min-height: 0; }
.sidebar { width: 250px; flex: 0 0 250px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--nav); }
.sidebar-head { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid #e6eaf0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-close { display: none; }
.side-nav { padding: 12px 10px 0; overflow-y: auto; }
.nav-link, .nav-group-title { min-height: 43px; display: flex; align-items: center; width: 100%; gap: 10px; padding: 0 14px; color: #344258; border-radius: 5px; background: transparent; font-size: 14px; font-weight: 600; transition: color .15s, background .15s; }
.nav-link:hover, .nav-group-title:hover { color: var(--accent); background: #eef1f5; }
.nav-link.is-active { color: var(--accent); background: var(--accent-pale); }
.nav-link.is-active::before { content: ""; width: 3px; height: 23px; margin-left: -14px; margin-right: 1px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-icon { width: 21px; display: inline-grid; place-items: center; color: currentColor; font-size: 18px; line-height: 1; }
.nav-group { margin-top: 3px; }
.nav-group-title { justify-content: space-between; cursor: pointer; }
.nav-group-title > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.nav-caret { color: #9aa5b2; font-size: 16px; transition: transform .2s; }
.nav-group-title[aria-expanded="false"] .nav-caret { transform: rotate(-90deg); }
.nav-children { display: grid; max-height: 300px; overflow: hidden; transition: max-height .2s ease; }
.nav-group-title[aria-expanded="false"] + .nav-children { max-height: 0; }
.nav-children .nav-link { min-height: 37px; padding-left: 46px; font-size: 13px; font-weight: 500; }
.nav-children .nav-link.is-active::before { margin-left: -46px; }
.nav-children em { min-width: 18px; margin-left: auto; padding: 1px 5px; color: #fff; border-radius: 9px; background: var(--accent); font-size: 10px; font-style: normal; text-align: center; }
.nav-new { margin-left: auto; padding: 2px 5px; color: var(--teal); border: 1px solid rgba(7,143,157,.28); border-radius: 3px; font-size: 9px; letter-spacing: .06em; }
.nav-separator { height: 1px; margin: 14px 12px; background: var(--line); }
.admin-link { color: #647185; }
.sidebar-note { display: flex; align-items: center; gap: 9px; margin: auto 16px 20px; padding: 11px 12px; border: 1px solid #dce6e2; border-radius: 5px; background: #f1f8f5; color: var(--green); }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 12px; }
.sidebar-note small { margin-top: 2px; color: #719484; font-size: 10px; }
.pulse { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(33,136,93,.12); }
.sidebar-overlay { display: none; }

.page-content { width: calc(100% - 250px); min-width: 0; overflow-y: auto; padding: 28px 34px 42px; background: var(--canvas); }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-header h1 { margin: 0; color: var(--ink); font-size: 28px; line-height: 1.2; letter-spacing: .01em; }
.page-header p { margin: 7px 0 0; color: var(--ink-soft); }
.page-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.page-kicker { margin: 0 0 7px; color: var(--teal); font-size: 11px; font-weight: 750; letter-spacing: .16em; }
.small-button, .outline-button, .danger-button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink-soft); background: #fff; font-size: 13px; font-weight: 650; transition: border .16s, color .16s, background .16s; }
.small-button:hover, .outline-button:hover { color: var(--blue); border-color: #a8c7ec; background: #f8fbff; }
.danger-button { color: var(--accent); border-color: #f2c4c7; background: #fff7f7; }
.danger-button:hover { color: #fff; border-color: var(--accent); background: var(--accent); }

/* Shared panels and data components */
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: 0 3px 12px rgba(25,45,70,.025); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .panel-heading h3 { margin: 0; color: var(--ink); font-size: 17px; }
.panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.panel-body { padding: 20px; }
.muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.text-blue { color: var(--blue); }
.empty-state { padding: 45px 20px; color: var(--muted); text-align: center; }
.empty-state .empty-icon { display: block; margin-bottom: 8px; color: #bec8d3; font-size: 34px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; min-width: 700px; border-collapse: collapse; }
.data-table th { height: 43px; padding: 0 13px; color: #748195; background: #f6f8fa; font-size: 12px; font-weight: 700; text-align: left; white-space: nowrap; }
.data-table td { min-height: 54px; padding: 12px 13px; border-top: 1px solid #edf0f4; color: var(--ink-soft); vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfcfd; }
.data-table .primary-cell { color: var(--ink); font-weight: 650; }
.data-table .number-cell { color: var(--ink); font-variant-numeric: tabular-nums; }
.status-pill { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border-radius: 12px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-pill::before { content: ""; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: currentColor; }
.status-pill.success, .status-pill.online { color: var(--green); background: #eaf7f0; }
.status-pill.pending, .status-pill.warning { color: var(--amber); background: #fff5e5; }
.status-pill.danger, .status-pill.offline { color: var(--accent); background: #fff0f1; }
.status-pill.info { color: var(--blue); background: #edf4ff; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.field, .select-field { height: 36px; padding: 0 10px; border: 1px solid #d8e0e8; border-radius: 4px; color: var(--ink-soft); background: #fff; }
.field:focus, .select-field:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(40,119,212,.1); }
.pagination { display: flex; justify-content: flex-end; gap: 5px; padding: 15px 18px; }
.page-button { min-width: 29px; height: 29px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink-soft); background: #fff; font-size: 12px; }
.page-button.is-current, .page-button:hover { color: #fff; border-color: var(--blue); background: var(--blue); }
.tag { display: inline-flex; padding: 2px 7px; border: 1px solid #d9e0e8; border-radius: 3px; color: var(--ink-soft); background: #f8fafc; font-size: 11px; }

/* Overview */
.welcome-strip { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 23px; padding: 23px 27px; border: 1px solid #d7e6e9; border-radius: var(--radius); background: #eaf5f5; }
.welcome-strip h1 { margin: 0; color: var(--ink); font-size: 27px; line-height: 1.2; }
.welcome-strip p { margin: 6px 0 0; color: var(--ink-soft); }
.welcome-date { min-width: 145px; padding-left: 22px; border-left: 1px solid #c5d9db; text-align: right; }
.welcome-date strong { display: block; color: var(--teal); font-size: 22px; }
.welcome-date span { color: var(--ink-soft); font-size: 12px; }
.overview-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.stat-card { grid-column: span 3; position: relative; min-height: 145px; padding: 19px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; width: 95px; height: 95px; right: -27px; bottom: -33px; border: 13px solid rgba(7,143,157,.07); border-radius: 50%; }
.stat-label { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.stat-symbol { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 5px; color: var(--teal); background: #e4f4f4; font-size: 17px; }
.stat-value { margin-top: 14px; color: var(--ink); font-size: 30px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-value small { margin-left: 5px; color: var(--muted); font-size: 12px; font-weight: 500; }
.stat-foot { display: flex; align-items: center; gap: 6px; margin-top: 11px; color: var(--muted); font-size: 11px; }
.stat-trend { color: var(--green); font-weight: 700; }
.stat-card.balance { grid-column: span 6; background: var(--ink); border-color: var(--ink); }
.stat-card.balance .stat-label, .stat-card.balance .stat-value { color: #fff; }
.stat-card.balance .stat-symbol { color: #bdecee; background: rgba(255,255,255,.14); }
.stat-card.balance::after { border-color: rgba(85,213,214,.14); }
.balance-actions { display: flex; gap: 8px; margin-top: 16px; }
.balance-actions button { min-height: 32px; padding: 0 14px; border: 1px solid rgba(255,255,255,.26); border-radius: 4px; color: #fff; background: rgba(255,255,255,.08); font-size: 12px; }
.balance-actions button:first-child { border-color: #ef8a8e; background: var(--accent); }
.balance-actions button:hover { background: rgba(255,255,255,.18); }
.overview-lower { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .8fr); gap: 18px; margin-top: 18px; }
.products-card { min-height: 240px; }
.product-list { display: grid; gap: 0; }
.product-row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; min-height: 68px; padding: 0 20px; border-bottom: 1px solid #edf0f4; }
.product-row:last-child { border-bottom: 0; }
.product-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--teal); border-radius: 5px; background: #e8f6f5; font-size: 18px; }
.product-row strong { display: block; color: var(--ink); font-size: 13px; }
.product-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.product-row .row-action { color: var(--accent); font-size: 12px; font-weight: 700; }
.notice-card { min-height: 240px; }
.notice-list { display: grid; }
.notice-item { display: block; padding: 14px 20px; border-bottom: 1px solid #edf0f4; }
.notice-item:last-child { border-bottom: 0; }
.notice-item:hover strong { color: var(--accent); }
.notice-item strong { display: block; color: var(--ink); font-size: 13px; transition: color .15s; }
.notice-item p { display: -webkit-box; overflow: hidden; margin: 4px 0 0; color: var(--ink-soft); font-size: 12px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.notice-item time { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.quick-actions { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 11px; margin-top: 18px; }
.quick-action { min-height: 74px; display: grid; place-items: center; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-soft); background: #fff; font-size: 12px; transition: border .16s, color .16s, transform .16s; }
.quick-action span { color: var(--teal); font-size: 22px; }
.quick-action:hover { color: var(--accent); border-color: #edb9bd; transform: translateY(-2px); }

/* Products / orders */
.catalog-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 18px; }
.catalog-filters { align-self: start; padding: 17px; }
.catalog-filters h3 { margin: 0 0 15px; font-size: 14px; }
.filter-label { display: grid; gap: 6px; margin-bottom: 14px; color: var(--ink-soft); font-size: 12px; }
.filter-label select, .filter-label input { width: 100%; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink-soft); background: #fff; }
.filter-label input:focus, .filter-label select:focus { border-color: var(--blue); outline: none; }
.catalog-list { display: grid; gap: 12px; }
.node-card { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 18px; padding: 17px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; transition: box-shadow .16s, border .16s, transform .16s; }
.node-card:hover { border-color: #b8cee8; box-shadow: var(--shadow); transform: translateY(-1px); }
.node-main { min-width: 0; }
.node-title { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; font-weight: 700; }
.node-flag { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(33,136,93,.1); }
.node-meta { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 7px; color: var(--muted); font-size: 11px; }
.node-meta b { color: var(--ink-soft); font-weight: 600; }
.node-price { color: var(--accent); font-size: 19px; font-weight: 750; white-space: nowrap; }
.node-price small { margin-left: 2px; color: var(--muted); font-size: 11px; font-weight: 500; }
.node-action { min-width: 74px; height: 34px; border-radius: 4px; color: #fff; background: var(--accent); font-size: 12px; font-weight: 700; }
.node-action:hover { background: var(--accent-dark); }
.node-action:disabled { color: #8794a3; background: #e8edf2; }
.orders-panel { overflow: hidden; }
.order-id { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.order-node { display: block; color: var(--ink); font-weight: 650; }
.order-node small { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; }
.cart-summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 20px; border-top: 1px solid var(--line); background: #fbfcfd; }
.cart-summary strong { color: var(--accent); font-size: 20px; }
.cart-summary-actions { display: flex; gap: 8px; }

/* Finance */
.finance-top { display: grid; grid-template-columns: minmax(0,1fr) minmax(240px,.55fr); gap: 18px; margin-bottom: 18px; }
.finance-balance { padding: 22px; color: #fff; border-radius: var(--radius); background: var(--ink); }
.finance-balance .label { color: #afbdcc; font-size: 12px; }
.finance-balance .amount { margin: 8px 0 18px; font-size: 34px; font-weight: 750; }
.finance-balance .amount small { margin-left: 5px; color: #9fb0bf; font-size: 13px; font-weight: 500; }
.balance-breakdown { display: flex; gap: 28px; }
.balance-breakdown span { display: grid; gap: 2px; color: #b8c4d0; font-size: 11px; }
.balance-breakdown b { color: #fff; font-size: 14px; }
.finance-tip { padding: 20px; border: 1px solid #d9e7ea; border-radius: var(--radius); background: #eaf6f6; }
.finance-tip strong { display: block; color: var(--teal); }
.finance-tip p { margin: 8px 0 0; color: var(--ink-soft); font-size: 12px; }
.finance-tabs { display: flex; gap: 24px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.finance-tab { position: relative; height: 48px; color: var(--muted); background: transparent; font-weight: 650; }
.finance-tab.is-active { color: var(--accent); }
.finance-tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.recharge-form { max-width: 620px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.form-control { display: grid; gap: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.form-control.full { grid-column: 1/-1; }
.form-control input, .form-control select, .form-control textarea { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: #fff; resize: vertical; }
.form-control input:focus, .form-control select:focus, .form-control textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(40,119,212,.1); }
.amount-input { position: relative; }
.amount-input span { position: absolute; left: 11px; top: 8px; color: var(--ink-soft); font-size: 17px; }
.amount-input input { padding-left: 28px; }
.method-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.method-option { position: relative; min-width: 110px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink-soft); background: #fff; text-align: center; cursor: pointer; }
.method-option input { position: absolute; opacity: 0; pointer-events: none; }
.method-option.is-selected { border-color: var(--accent); color: var(--accent); background: var(--accent-pale); box-shadow: 0 0 0 1px var(--accent); }
.method-option small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.method-option.is-selected small { color: #d6787c; }
.form-actions { display: flex; gap: 8px; margin-top: 7px; }
.table-note { padding: 14px 20px; color: var(--muted); font-size: 12px; background: #fbfcfd; }

/* Account / marketing / docs */
.account-layout { display: grid; grid-template-columns: 270px minmax(0,1fr); gap: 18px; }
.profile-card { padding: 24px 20px; text-align: center; }
.profile-avatar { width: 74px; height: 74px; display: grid; place-items: center; margin: 0 auto 12px; color: #fff; border-radius: 50%; background: var(--teal); font-size: 27px; font-weight: 750; }
.profile-card h2 { margin: 0; color: var(--ink); font-size: 20px; }
.profile-card p { margin: 4px 0 18px; color: var(--muted); font-size: 12px; }
.profile-stats { display: grid; grid-template-columns: repeat(2,1fr); border-top: 1px solid var(--line); }
.profile-stats div { padding: 13px 5px 2px; }
.profile-stats div + div { border-left: 1px solid var(--line); }
.profile-stats b, .profile-stats span { display: block; }
.profile-stats b { color: var(--ink); font-size: 16px; }
.profile-stats span { color: var(--muted); font-size: 11px; }
.settings-panel .panel-body { padding: 23px; }
.settings-section + .settings-section { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.settings-section h3 { margin: 0 0 15px; color: var(--ink); font-size: 15px; }
.promo-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.promo-card { min-height: 190px; display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.promo-card .promo-icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 14px; color: var(--teal); border-radius: 5px; background: #e6f5f4; font-size: 20px; }
.promo-card h3 { margin: 0; color: var(--ink); font-size: 15px; }
.promo-card p { flex: 1; margin: 7px 0 16px; color: var(--ink-soft); font-size: 12px; }
.promo-card .small-button { align-self: flex-start; }
.referral-panel { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; padding: 19px 20px; border: 1px solid #d9e7ea; border-radius: var(--radius); background: #eaf6f6; }
.referral-panel h3 { margin: 0; color: var(--teal); font-size: 15px; }
.referral-panel p { margin: 5px 0 0; color: var(--ink-soft); font-size: 12px; }
.referral-code { display: inline-flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px dashed #99c9cb; border-radius: 4px; color: var(--ink); background: #fff; font-family: ui-monospace, monospace; font-size: 13px; }
.docs-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 18px; }
.docs-menu { align-self: start; overflow: hidden; }
.docs-menu button { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 15px; color: var(--ink-soft); background: #fff; border-bottom: 1px solid #edf0f4; text-align: left; font-size: 12px; }
.docs-menu button.is-active { color: var(--accent); background: var(--accent-pale); font-weight: 700; box-shadow: inset 3px 0 var(--accent); }
.docs-menu button:last-child { border-bottom: 0; }
.credential-card { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; margin-bottom: 18px; }
.credential-block { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.credential-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.credential-title strong { color: var(--ink); font-size: 14px; }
.credential-title span { padding: 2px 6px; border: 1px solid #ccd8e4; border-radius: 3px; color: var(--muted); font-size: 10px; }
.credential-row { display: grid; grid-template-columns: 76px minmax(0,1fr) auto; align-items: center; gap: 8px; min-height: 40px; margin-top: 7px; padding: 0 10px; border: 1px solid #e0e6ed; border-radius: 4px; background: #f7f9fb; }
.credential-row label { color: var(--muted); font-size: 10px; letter-spacing: .1em; }
.credential-row code { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.copy-button { min-width: 40px; height: 26px; border: 1px solid #b9d2ec; border-radius: 4px; color: var(--blue); background: #fff; font-size: 11px; }
.copy-button:hover { color: #fff; border-color: var(--blue); background: var(--blue); }
.docs-content { min-width: 0; padding: 23px; }
.docs-content h2 { margin: 0; color: var(--ink); font-size: 20px; }
.docs-content > p { margin: 7px 0 20px; color: var(--ink-soft); font-size: 12px; }
.endpoint { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #dfe5eb; border-radius: 4px; background: #f7f9fb; }
.http-method { padding: 3px 6px; border-radius: 3px; color: #fff; background: #e2a227; font-size: 10px; font-weight: 750; }
.endpoint code { overflow-x: auto; color: var(--ink); font-size: 12px; white-space: nowrap; }
.doc-table { margin-top: 17px; }
.code-block { overflow-x: auto; margin-top: 17px; padding: 14px; border-radius: 4px; color: #d8e6f5; background: #1a2a40; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; line-height: 1.7; }
.code-block .key { color: #7ed7ca; }
.code-block .string { color: #f2c785; }

/* Admin */
.admin-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 21px 24px; margin-bottom: 18px; border-radius: var(--radius); color: #fff; background: var(--ink); }
.admin-banner h1 { margin: 0; font-size: 22px; }
.admin-banner p { margin: 4px 0 0; color: #adbdcf; font-size: 12px; }
.admin-banner .admin-badge { padding: 5px 9px; border: 1px solid rgba(255,255,255,.25); border-radius: 4px; color: #c9f0e1; background: rgba(255,255,255,.08); font-size: 11px; }
.admin-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.admin-stat { padding: 17px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.admin-stat span, .admin-stat b { display: block; }
.admin-stat span { color: var(--muted); font-size: 11px; }
.admin-stat b { margin-top: 5px; color: var(--ink); font-size: 24px; }
.admin-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(270px,.8fr); gap: 18px; }
.health-list { display: grid; gap: 10px; }
.health-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border: 1px solid #edf0f4; border-radius: 4px; }
.health-item strong { color: var(--ink); font-size: 12px; }
.health-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

/* Modal and notifications */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(15,28,46,.5); }
.modal { width: min(520px, 100%); max-height: min(700px, calc(100vh - 36px)); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 22px 55px rgba(10,24,44,.28); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 58px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-close { width: 30px; height: 30px; border-radius: 4px; color: var(--muted); background: transparent; font-size: 21px; }
.modal-close:hover { color: var(--accent); background: var(--accent-pale); }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfcfd; }
.toast-region { position: fixed; top: 88px; right: 24px; z-index: 200; display: grid; gap: 8px; width: min(340px, calc(100% - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 9px; padding: 12px 13px; border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 5px; color: var(--ink-soft); background: #fff; box-shadow: var(--shadow); animation: toast-in .22s ease both; font-size: 12px; }
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--accent); }
.toast strong { display: block; color: var(--ink); font-size: 12px; }
.toast p { margin: 2px 0 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.app-footer { display: flex; flex: 0 0 42px; align-items: center; gap: 17px; min-height: 42px; padding: 0 34px; color: #8f9baa; border-top: 1px solid var(--line); background: #f7f9fb; font-size: 11px; }
.app-footer span:not(:first-child):not(.footer-domain) { cursor: pointer; }
.footer-domain { margin-left: auto; color: var(--teal); }

/* Responsive */
@media (max-width: 1180px) {
  .topbar { grid-template-columns: 220px 1fr 295px; padding: 0 18px; }
  .sidebar { width: 220px; flex-basis: 220px; }
  .page-content { width: calc(100% - 220px); padding: 24px 22px 36px; }
  .stat-card { grid-column: span 4; }
  .stat-card.balance { grid-column: span 8; }
  .overview-lower { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .topbar { height: 64px; flex-basis: 64px; grid-template-columns: 1fr auto; }
  .mobile-menu { display: inline-grid; place-items: center; width: 36px; height: 36px; margin-right: 8px; color: var(--ink); background: transparent; font-size: 20px; }
  .topbar-slogan { display: none; }
  .topbar-actions { gap: 6px; }
  .top-action { width: 38px; height: 38px; }
  .top-icon { font-size: 20px; }
  .user-menu { height: 40px; }
  .avatar { width: 31px; height: 31px; }
  .sidebar { position: fixed; inset: 64px auto 0 0; z-index: 60; width: 250px; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 10px 0 28px rgba(20,35,56,.18); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close { display: inline-grid; place-items: center; width: 28px; height: 28px; color: var(--muted); background: transparent; font-size: 21px; }
  .sidebar-overlay { position: fixed; inset: 64px 0 0; z-index: 50; display: block; visibility: hidden; background: rgba(17,32,50,.35); opacity: 0; transition: opacity .2s, visibility .2s; }
  .sidebar.is-open + .sidebar-overlay { visibility: visible; opacity: 1; }
  .page-content { width: 100%; padding: 22px 18px 34px; }
  .catalog-layout, .docs-layout { grid-template-columns: 1fr; }
  .catalog-filters, .docs-menu { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  .catalog-filters h3 { width: 100%; margin-bottom: 0; }
  .filter-label { flex: 1 1 150px; margin-bottom: 0; }
  .docs-menu button { width: auto; flex: 1 1 150px; justify-content: center; border-right: 1px solid #edf0f4; border-bottom: 0; }
  .credential-card { grid-template-columns: 1fr; }
  .account-layout { grid-template-columns: 1fr; }
  .profile-card { display: grid; grid-template-columns: auto 1fr; gap: 0 15px; align-items: center; text-align: left; }
  .profile-avatar { grid-row: span 2; margin: 0; }
  .profile-card p { margin-bottom: 10px; }
  .profile-stats { grid-column: 1/-1; margin-top: 13px; }
}
@media (max-width: 640px) {
  body { font-size: 13px; }
  .topbar { padding: 0 10px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand-mark img { width: 43px; height: 43px; }
  .brand-words strong { font-size: 18px; }
  .brand-words small { font-size: 9px; }
  .top-action { width: 34px; height: 34px; }
  .top-action:nth-child(3) { display: none; }
  .user-menu > #header-user, .user-menu .chevron { display: none; }
  .page-content { padding: 17px 12px 28px; }
  .page-header { display: block; margin-bottom: 17px; }
  .page-header h1 { font-size: 23px; }
  .page-header-actions { justify-content: flex-start; margin-top: 13px; }
  .welcome-strip { display: block; padding: 18px; }
  .welcome-strip h1 { font-size: 23px; }
  .welcome-date { margin-top: 14px; padding: 10px 0 0; border-top: 1px solid #c5d9db; border-left: 0; text-align: left; }
  .overview-grid { gap: 10px; }
  .stat-card, .stat-card.balance { grid-column: span 12; min-height: 127px; }
  .quick-actions { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .panel-heading, .panel-body { padding-left: 15px; padding-right: 15px; }
  .node-card { grid-template-columns: 1fr auto; gap: 9px 12px; padding: 14px; }
  .node-price { justify-self: end; grid-column: 2; grid-row: 1; }
  .node-action { grid-column: 1/-1; width: 100%; }
  .finance-top { grid-template-columns: 1fr; }
  .finance-tabs { gap: 15px; padding: 0 14px; overflow-x: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-control.full { grid-column: auto; }
  .promo-grid { grid-template-columns: 1fr; }
  .referral-panel { display: block; }
  .referral-code { margin-top: 13px; }
  .credential-row { grid-template-columns: 58px minmax(0,1fr) auto; }
  .docs-content { padding: 16px; }
  .admin-stats { grid-template-columns: repeat(2,1fr); gap: 9px; }
  .admin-grid { grid-template-columns: 1fr; }
  .app-footer { flex-wrap: wrap; gap: 8px 14px; padding: 10px 13px; }
  .footer-domain { margin-left: 0; width: 100%; }
  .login-panel { padding: 27px 22px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
