:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --text: #182230;
    --text-secondary: #667085;
    --text-muted: #98a2b3;
    --line: #e7ecf2;
    --line-strong: #d9e1eb;
    --primary: #16b77e;
    --primary-dark: #0b9666;
    --primary-soft: #eaf9f3;
    --blue: #4385f5;
    --blue-soft: #edf4ff;
    --violet: #8264e8;
    --violet-soft: #f2efff;
    --orange: #ee9545;
    --orange-soft: #fff4e9;
    --red: #e45461;
    --red-soft: #fff0f1;
    --shadow-sm: 0 3px 12px rgba(32, 54, 82, .04);
    --shadow-md: 0 14px 40px rgba(32, 54, 82, .08);
    --shadow-lg: 0 28px 80px rgba(22, 42, 68, .16);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --sidebar-width: 252px;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { line-height: 1.3; }
ul, ol, dl, dd { margin: 0; padding: 0; }
code, pre {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
code { font-size: .92em; }
[hidden] { display: none !important; }
::selection { color: #0b674a; background: #c9f4e3; }
:focus-visible { outline: 3px solid rgba(67, 133, 245, .28); outline-offset: 2px; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }

/* Brand */
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand-mark {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    width: 38px;
    height: 38px;
    padding: 9px;
    border-radius: 12px;
    background: linear-gradient(145deg, #20cf91, #16a97b 58%, #308ddf);
    box-shadow: 0 8px 20px rgba(22, 183, 126, .22);
    transform: rotate(-3deg);
}
.brand-mark span { display: block; width: 4px; border-radius: 4px; background: #fff; transform: rotate(3deg); }
.brand-mark span:nth-child(1) { height: 9px; opacity: .78; }
.brand-mark span:nth-child(2) { height: 18px; }
.brand-mark span:nth-child(3) { height: 13px; opacity: .9; }
.brand-mark-large { width: 44px; height: 44px; border-radius: 14px; }
.brand-name { font-size: 20px; font-weight: 750; letter-spacing: -.5px; }
.brand-name small { display: block; margin-top: -2px; color: var(--text-muted); font-size: 11px; font-weight: 500; letter-spacing: 1px; }

/* Shared controls */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 17px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button .icon { width: 17px; height: 17px; }
.button-primary { color: #fff; background: var(--primary); box-shadow: 0 7px 16px rgba(22, 183, 126, .18); }
.button-primary:hover:not(:disabled) { background: var(--primary-dark); box-shadow: 0 9px 22px rgba(22, 183, 126, .24); }
.button-secondary { color: #344054; background: #fff; border-color: var(--line-strong); }
.button-secondary:hover:not(:disabled) { background: var(--surface-soft); border-color: #c4d0dd; }
.button-plain { color: var(--text-secondary); background: transparent; }
.button-plain:hover:not(:disabled) { color: var(--text); background: #f0f3f7; }
.button-soft { color: var(--primary-dark); background: var(--primary-soft); }
.button-soft:hover:not(:disabled) { background: #dcf5eb; }
.button-danger-soft { color: #ce414f; background: var(--red-soft); border-color: #ffdce0; }
.button-danger-soft:hover:not(:disabled) { background: #ffe3e6; }
.button-white { color: #11865f; background: #fff; box-shadow: 0 8px 20px rgba(0, 94, 66, .12); }
.button-ghost-light { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.38); }
.button-ghost-light:hover:not(:disabled) { background: rgba(255,255,255,.16); }
.button-block { width: 100%; }
.button-large { min-height: 48px; border-radius: 13px; font-size: 15px; }
.button-small { min-height: 32px; padding: 5px 11px; border-radius: 8px; font-size: 12px; }
.button-link { min-height: 30px; padding: 4px 7px; color: var(--blue); background: transparent; border: 0; font-size: 12px; font-weight: 600; }
.button-link.danger { color: var(--red); }
.button-link:hover:not(:disabled) { background: var(--blue-soft); transform: none; }
.button-link.danger:hover:not(:disabled) { background: var(--red-soft); }
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--text-secondary);
    background: rgba(255,255,255,.76);
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: color .18s, background .18s, transform .18s;
}
.icon-button:hover { color: var(--primary); background: #fff; transform: translateY(-1px); }
.icon-button.loading .icon { animation: spin .8s linear infinite; }
.text-button, .copy-button, .mini-copy {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px;
    color: var(--primary-dark);
    background: none;
    border: 0;
    font-size: 12px;
    font-weight: 600;
}
.text-button .icon, .copy-button .icon { width: 15px; height: 15px; }
.text-button:hover, .copy-button:hover, .mini-copy:hover { color: var(--primary); }
.eyebrow { display: block; margin-bottom: 9px; color: var(--primary-dark); font-size: 10px; font-weight: 750; letter-spacing: 1.8px; }
.eyebrow.light { color: rgba(255,255,255,.74); }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px rgba(22,183,126,.1); }
.soft-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 10px; color: var(--primary-dark); background: var(--primary-soft); border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }

/* Login */
.login-body { background: #fff; }
.login-shell { display: grid; grid-template-columns: minmax(400px, 1.02fr) minmax(480px, .98fr); min-height: 100vh; }
.login-intro {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 48px clamp(44px, 6vw, 92px);
    color: #fff;
    background: linear-gradient(145deg, #0d9e75 0%, #16b886 45%, #397fd6 125%);
    overflow: hidden;
}
.login-brand { position: relative; z-index: 2; display: flex; align-items: center; gap: 13px; font-size: 23px; font-weight: 750; letter-spacing: -.5px; }
.login-brand .brand-mark { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.18); box-shadow: none; }
.intro-copy { position: relative; z-index: 2; margin: auto 0 64px; max-width: 550px; }
.intro-copy h1 { margin-bottom: 24px; font-size: clamp(42px, 4.4vw, 66px); font-weight: 700; letter-spacing: -2.5px; line-height: 1.2; }
.intro-copy p { max-width: 460px; color: rgba(255,255,255,.8); font-size: 16px; line-height: 1.9; }
.intro-feature-grid { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.intro-feature { display: flex; align-items: center; gap: 13px; padding: 18px; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.15); border-radius: 16px; backdrop-filter: blur(12px); }
.intro-feature > .icon { width: 24px; height: 24px; opacity: .9; }
.intro-feature strong, .intro-feature span { display: block; }
.intro-feature strong { margin-bottom: 2px; font-size: 14px; }
.intro-feature span { color: rgba(255,255,255,.67); font-size: 11px; }
.intro-orb { position: absolute; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.intro-orb-one { right: -190px; top: 14%; width: 460px; height: 460px; box-shadow: 0 0 0 65px rgba(255,255,255,.025), 0 0 0 130px rgba(255,255,255,.018); }
.intro-orb-two { left: -90px; bottom: -150px; width: 330px; height: 330px; background: rgba(255,255,255,.025); }
.login-panel { display: grid; place-items: center; padding: 50px clamp(36px, 7vw, 110px); background: radial-gradient(circle at 90% 10%, #effaf6, transparent 35%), #fff; }
.login-card { width: 100%; max-width: 410px; }
.login-card h2 { margin-bottom: 10px; font-size: 32px; letter-spacing: -1px; }
.login-subtitle { margin-bottom: 34px; color: var(--text-secondary); font-size: 14px; }
.field-label { display: block; margin: 19px 0 8px; color: #344054; font-size: 13px; font-weight: 600; }
.input-with-icon { position: relative; }
.input-with-icon > .icon { position: absolute; left: 15px; top: 50%; width: 18px; height: 18px; color: var(--text-muted); transform: translateY(-50%); pointer-events: none; }
.input-with-icon input { width: 100%; height: 48px; padding: 11px 44px; color: var(--text); background: #fafbfc; border: 1px solid var(--line-strong); border-radius: 12px; outline: none; transition: border .18s, box-shadow .18s, background .18s; }
.input-with-icon input:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(22,183,126,.09); }
.input-icon-button { position: absolute; right: 7px; top: 50%; display: grid; place-items: center; width: 35px; height: 35px; padding: 0; color: var(--text-muted); background: transparent; border: 0; border-radius: 8px; transform: translateY(-50%); }
.input-icon-button:hover { color: var(--text); background: #eef2f5; }
.input-icon-button .icon { width: 18px; height: 18px; }
.form-error { margin-top: 14px; padding: 9px 12px; color: #c73e4b; background: var(--red-soft); border-radius: 9px; font-size: 12px; }
#login-form .button-block { margin-top: 27px; }
#login-form .button-block .icon { margin-left: auto; }
.login-security { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 25px; color: var(--text-muted); font-size: 11px; }
.login-security .icon { width: 15px; height: 15px; }
.mobile-login-brand { display: none; }

/* App frame */
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0,1fr); min-height: 100vh; }
.sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 27px 19px 20px;
    background: rgba(255,255,255,.92);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(18px);
}
.sidebar-workspace { display: flex; align-items: center; gap: 11px; margin: 30px 3px 25px; padding: 13px; background: linear-gradient(135deg, #f3fbf8, #f7fafc); border: 1px solid #e8f3ee; border-radius: 14px; }
.workspace-avatar, .account-avatar { display: grid; place-items: center; flex: 0 0 auto; color: #fff; background: linear-gradient(145deg, #42cda0, #478adf); border-radius: 10px; font-weight: 700; text-transform: uppercase; }
.workspace-avatar { width: 35px; height: 35px; font-size: 13px; }
.sidebar-workspace div { min-width: 0; }
.sidebar-workspace small, .sidebar-workspace strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-workspace small { color: var(--text-muted); font-size: 10px; }
.sidebar-workspace strong { max-width: 137px; font-size: 13px; font-weight: 600; }
.sidebar-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-section-label { padding: 0 13px 8px; color: var(--text-muted); font-size: 10px; font-weight: 600; letter-spacing: 1px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 10px 13px; color: #667085; background: transparent; border: 0; border-radius: 12px; text-align: left; font-size: 13px; font-weight: 500; transition: color .18s, background .18s; }
.nav-item::before { position: absolute; left: -19px; top: 12px; width: 3px; height: 22px; background: var(--primary); border-radius: 0 4px 4px 0; content: ""; opacity: 0; }
.nav-item .icon { width: 19px; height: 19px; }
.nav-item:hover { color: var(--primary-dark); background: #f2f8f6; }
.nav-item.active { color: var(--primary-dark); background: var(--primary-soft); font-weight: 650; }
.nav-item.active::before { opacity: 1; }
.nav-count { min-width: 20px; margin-left: auto; padding: 0 6px; color: #c36e2b; background: var(--orange-soft); border-radius: 10px; font-size: 10px; text-align: center; }
.sidebar-bottom { margin-top: auto; }
.sidebar-status { display: flex; align-items: center; gap: 9px; margin: 0 12px 14px; color: var(--text-muted); font-size: 11px; }
.sidebar-status .status-dot { width: 6px; height: 6px; }
.sidebar-logout { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 13px; color: var(--text-secondary); background: #f8fafc; border: 1px solid transparent; border-radius: 11px; font-size: 12px; }
.sidebar-logout:hover { color: var(--red); background: var(--red-soft); border-color: #ffe5e8; }
.sidebar-logout .icon { width: 17px; height: 17px; }
.main-column { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 103px; padding: 22px 36px; background: rgba(244,247,251,.82); border-bottom: 1px solid rgba(224,231,239,.75); backdrop-filter: blur(18px); }
.topbar-kicker { display: block; margin-bottom: 2px; color: var(--text-muted); font-size: 9px; font-weight: 650; letter-spacing: 1.4px; }
.topbar-heading h1 { display: inline; margin-right: 10px; font-size: 22px; letter-spacing: -.5px; }
.topbar-heading p { display: inline; color: var(--text-secondary); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 11px; }
.account-chip { display: flex; align-items: center; gap: 10px; margin-right: 7px; padding-right: 17px; border-right: 1px solid var(--line-strong); }
.account-avatar { width: 37px; height: 37px; border-radius: 11px; font-size: 13px; }
.account-chip strong, .account-chip span { display: block; }
.account-chip strong { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.account-chip div > span { color: var(--text-muted); font-size: 10px; }
.mobile-logout, .mobile-nav { display: none; }
.content { width: 100%; max-width: 1560px; margin: 0 auto; padding: 30px 36px 40px; flex: 1; }
.view { animation: view-in .24s ease both; }
.app-footer { display: flex; justify-content: space-between; gap: 20px; max-width: 1560px; width: 100%; margin: auto auto 0; padding: 0 36px 23px; color: var(--text-muted); font-size: 10px; }
.app-footer span:last-child { display: flex; align-items: center; gap: 7px; }
.app-footer .status-dot { width: 5px; height: 5px; box-shadow: none; }

/* Shared cards and page headings */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 23px 25px 19px; }
.card-header h3 { margin-bottom: 5px; font-size: 16px; }
.card-header p { color: var(--text-secondary); font-size: 11px; }
.card-body-flush { min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-heading h2 { margin-bottom: 7px; font-size: 23px; letter-spacing: -.5px; }
.section-heading p { color: var(--text-secondary); font-size: 13px; }

/* Overview */
.welcome-banner { position: relative; display: flex; justify-content: space-between; min-height: 245px; margin-bottom: 22px; padding: 34px 40px; color: #fff; background: linear-gradient(118deg, #11a977 0%, #1cbd8c 45%, #3a9ac8 125%); border-radius: 24px; box-shadow: 0 18px 40px rgba(20,169,121,.15); overflow: hidden; }
.welcome-copy { position: relative; z-index: 2; }
.welcome-copy h2 { margin-bottom: 11px; font-size: 29px; letter-spacing: -.8px; }
.welcome-copy > p { color: rgba(255,255,255,.77); font-size: 13px; }
.welcome-actions { display: flex; gap: 10px; margin-top: 28px; }
.welcome-visual { position: relative; width: 300px; flex: 0 0 300px; }
.visual-ring { position: absolute; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; }
.ring-one { right: -72px; top: -105px; width: 330px; height: 330px; box-shadow: 0 0 0 45px rgba(255,255,255,.025); }
.ring-two { right: 55px; top: 12px; width: 150px; height: 150px; }
.visual-card { position: absolute; right: 19px; top: 23px; display: flex; flex-direction: column; width: 174px; padding: 21px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.23); border-radius: 20px; box-shadow: 0 18px 35px rgba(0,99,72,.12); backdrop-filter: blur(13px); transform: rotate(3deg); }
.visual-card span { color: rgba(255,255,255,.8); font-size: 11px; }
.visual-card strong { margin: 4px 0; font-size: 40px; line-height: 1.3; }
.visual-card small { color: rgba(255,255,255,.63); font-size: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; margin-bottom: 22px; }
.stat-card { position: relative; min-width: 0; padding: 22px 23px; background: #fff; border: 1px solid var(--line); border-radius: 19px; box-shadow: var(--shadow-sm); overflow: hidden; }
.stat-card::after { position: absolute; right: -24px; bottom: -35px; width: 100px; height: 100px; background: currentColor; border-radius: 50%; content: ""; opacity: .025; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; color: var(--text-secondary); font-size: 12px; }
.stat-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; font-size: 16px; font-weight: 600; }
.stat-icon .icon { width: 16px; height: 16px; }
.stat-card > strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 27px; font-weight: 700; line-height: 1.4; letter-spacing: -.7px; }
.stat-caption { color: var(--text-muted); font-size: 10px; }
.stat-green { color: var(--primary); } .stat-green .stat-icon { color: var(--primary); background: var(--primary-soft); }
.stat-blue { color: var(--blue); } .stat-blue .stat-icon { color: var(--blue); background: var(--blue-soft); }
.stat-violet { color: var(--violet); } .stat-violet .stat-icon { color: var(--violet); background: var(--violet-soft); }
.stat-orange { color: var(--orange); } .stat-orange .stat-icon { color: var(--orange); background: var(--orange-soft); }
.overview-grid { display: grid; grid-template-columns: minmax(0,1fr) 315px; gap: 22px; align-items: start; }
.recent-card { min-width: 0; }
.merchant-overview-card { padding-bottom: 21px; }
.merchant-summary { display: flex; flex-direction: column; align-items: center; padding: 2px 24px 21px; text-align: center; }
.merchant-logo { display: grid; place-items: center; width: 63px; height: 63px; margin-bottom: 12px; background: var(--primary-soft); border-radius: 20px; }
.merchant-summary > strong { max-width: 100%; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.merchant-summary > span { color: var(--text-muted); font-size: 11px; }
.merchant-summary b { color: var(--text-secondary); font-family: "SFMono-Regular", Consolas, monospace; font-weight: 500; }
.compact-details { margin: 0 22px 19px; padding: 5px 0; border-top: 1px solid var(--line); }
.compact-details > div { display: grid; grid-template-columns: 70px minmax(0,1fr); gap: 10px; padding: 10px 0; border-bottom: 1px dashed #edf0f4; font-size: 11px; }
.compact-details dt { color: var(--text-muted); }
.compact-details dd { overflow: hidden; color: var(--text-secondary); text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.compact-details code { padding: 2px 6px; color: var(--primary-dark); background: var(--primary-soft); border-radius: 5px; }
.merchant-overview-card > .button { width: calc(100% - 44px); margin: 0 22px; }

/* Filters, tables and pagination */
.list-card { min-width: 0; overflow: hidden; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 26px 20px; }
.list-toolbar h2 { margin-bottom: 6px; font-size: 19px; }
.list-toolbar p { color: var(--text-secondary); font-size: 12px; }
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 26px 20px; padding: 13px; background: var(--surface-soft); border: 1px solid #edf0f4; border-radius: 14px; }
.filter-bar select, .filter-bar input { height: 38px; color: #344054; background: #fff; border: 1px solid var(--line-strong); border-radius: 9px; outline: none; }
.filter-bar select { min-width: 130px; padding: 7px 32px 7px 12px; }
.filter-bar input { width: 100%; padding: 8px 12px 8px 38px; }
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,183,126,.08); }
.search-field { position: relative; flex: 1; min-width: 240px; }
.search-field .icon { position: absolute; left: 13px; top: 50%; z-index: 1; width: 16px; height: 16px; color: var(--text-muted); transform: translateY(-50%); }
.table-scroll { width: 100%; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #d6dfe8 transparent; }
.data-table, .doc-table { width: 100%; border-collapse: collapse; border-spacing: 0; text-align: left; }
.data-table { min-width: 860px; }
.data-table.recent-table { min-width: 650px; }
.data-table th { padding: 12px 16px; color: var(--text-muted); background: #fafbfc; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 600; letter-spacing: .25px; white-space: nowrap; }
.data-table td { padding: 16px; color: #475467; border-bottom: 1px solid #edf0f4; font-size: 12px; vertical-align: middle; }
.data-table th:first-child, .data-table td:first-child { padding-left: 26px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 26px; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: #fbfdfc; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .cell-primary { display: block; max-width: 210px; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.data-table .cell-secondary { display: block; max-width: 220px; margin-top: 3px; overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; }
.money { color: var(--text); font-size: 13px; font-weight: 650; white-space: nowrap; }
.real-money { display: block; margin-top: 2px; color: var(--primary-dark); font-size: 10px; white-space: nowrap; }
.type-badge, .status-badge, .driver-badge { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 4px 9px; border-radius: 7px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.type-alipay { color: #2675d8; background: #edf5ff; }
.type-wxpay { color: #0b9666; background: #eaf9f3; }
.type-qqpay { color: #8a63cc; background: #f4efff; }
.type-default { color: #667085; background: #f0f2f5; }
.status-badge::before { width: 5px; height: 5px; background: currentColor; border-radius: 50%; content: ""; opacity: .8; }
.status-paid, .status-success, .status-enabled { color: #0b9666; background: #eaf9f3; }
.status-pending, .status-unpaid, .status-retrying { color: #c4782f; background: #fff4e8; }
.status-failed, .status-disabled { color: #d34e5a; background: #fff0f1; }
.status-neutral { color: #667085; background: #f1f3f6; }
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; white-space: nowrap; }
.table-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 25px; color: var(--text-muted); border-top: 1px solid var(--line); font-size: 11px; }
.pagination { display: flex; align-items: center; gap: 5px; }
.page-button { display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 9px; color: var(--text-secondary); background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 11px; }
.page-button:hover:not(:disabled) { color: var(--primary-dark); border-color: #bce6d5; background: var(--primary-soft); }
.page-button.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.page-button .icon { width: 14px; height: 14px; }

/* Loading, empty and errors */
.loading-state, .empty-state, .error-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 190px; padding: 35px 24px; color: var(--text-muted); text-align: center; font-size: 12px; }
.loading-state { flex-direction: row; min-height: 150px; }
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid #dcece6; border-top-color: var(--primary); border-radius: 50%; animation: spin .75s linear infinite; }
.empty-illustration { position: relative; display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 4px; color: #8aa398; background: #eff7f4; border-radius: 18px; }
.empty-illustration .icon { width: 26px; height: 26px; }
.empty-state strong, .error-state strong { color: #475467; font-size: 14px; }
.empty-state p, .error-state p { max-width: 380px; }
.error-state .empty-illustration { color: var(--red); background: var(--red-soft); }

/* Channels */
.driver-guide { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 22px; padding: 17px 20px; background: rgba(255,255,255,.66); border: 1px solid var(--line); border-radius: 17px; }
.driver-guide > div { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 3px 15px; border-right: 1px solid var(--line); }
.driver-guide > div:first-child { padding-left: 0; }
.driver-guide > div:last-child { border-right: 0; }
.guide-index { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; color: var(--primary-dark); background: var(--primary-soft); border-radius: 10px; font-size: 10px; font-weight: 700; }
.driver-guide strong, .driver-guide span { display: block; }
.driver-guide strong { margin-bottom: 2px; font-size: 12px; }
.driver-guide p > span { color: var(--text-muted); font-size: 10px; }
.channels-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.channel-card { min-width: 0; padding: 23px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.channel-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.channel-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 19px; }
.channel-type-icon { display: grid; place-items: center; flex: 0 0 auto; width: 43px; height: 43px; border-radius: 13px; font-size: 15px; font-weight: 750; }
.channel-title { flex: 1; min-width: 0; }
.channel-title h3 { margin: 2px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.channel-title p { color: var(--text-muted); font-size: 10px; }
.channel-status { margin-top: 3px; }
.channel-meta { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
.channel-meta > div { min-width: 0; padding: 11px 12px; background: var(--surface-soft); border-radius: 10px; }
.channel-meta span, .channel-meta strong { display: block; }
.channel-meta span { margin-bottom: 3px; color: var(--text-muted); font-size: 9px; }
.channel-meta strong { overflow: hidden; color: #475467; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 550; }
.channel-qr-row { display: flex; align-items: center; gap: 13px; margin-bottom: 15px; padding: 12px; background: #fbfdfc; border: 1px solid #e9f2ee; border-radius: 12px; }
.channel-qr-thumb { width: 54px; height: 54px; padding: 3px; object-fit: cover; background: #fff; border: 1px solid var(--line); border-radius: 8px; cursor: zoom-in; }
.channel-qr-placeholder { display: grid; place-items: center; flex: 0 0 auto; width: 54px; height: 54px; color: var(--primary); background: var(--primary-soft); border-radius: 9px; }
.channel-qr-placeholder .icon { width: 23px; height: 23px; }
.channel-qr-row > div { min-width: 0; }
.channel-qr-row strong { display: block; margin-bottom: 3px; font-size: 11px; }
.channel-qr-row p { max-width: 260px; overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.monitor-box { margin-bottom: 16px; padding: 13px; background: #f6f8fb; border: 1px solid #e9edf2; border-radius: 12px; }
.monitor-box-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--text-secondary); font-size: 10px; font-weight: 600; }
.monitor-line { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 6px; }
.monitor-line code { flex: 1; min-width: 0; overflow: hidden; color: #475467; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.monitor-line .mini-copy { flex: 0 0 auto; padding: 0 2px; font-size: 10px; }
.channel-card-actions { display: flex; align-items: center; gap: 7px; padding-top: 15px; border-top: 1px solid var(--line); }
.channel-card-actions .button:first-child { margin-right: auto; }
.query-detail { margin-bottom: 15px; padding: 10px 12px; color: var(--text-secondary); background: var(--blue-soft); border-radius: 9px; font-size: 10px; word-break: break-all; }

/* Modal forms and details */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 28px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(17,30,46,.42); backdrop-filter: blur(5px); animation: fade-in .18s ease both; }
.modal-dialog { position: relative; display: flex; flex-direction: column; width: min(620px,100%); max-height: calc(100vh - 56px); background: #fff; border: 1px solid rgba(255,255,255,.7); border-radius: 23px; box-shadow: var(--shadow-lg); overflow: hidden; animation: modal-in .22s ease both; }
.modal-dialog.modal-wide { width: min(860px,100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 23px 25px 18px; border-bottom: 1px solid var(--line); }
.modal-header .eyebrow { margin-bottom: 4px; }
.modal-header h2 { font-size: 19px; }
.modal-header .icon-button { width: 34px; height: 34px; background: var(--surface-soft); border: 0; }
.modal-body { padding: 23px 25px; overflow-y: auto; overscroll-behavior: contain; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 16px 25px; background: #fafbfc; border-top: 1px solid var(--line); }
body.modal-open { overflow: hidden; }
.channel-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
.form-field { min-width: 0; }
.form-field.full { grid-column: 1/-1; }
.form-field label, .credential-field > label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: #344054; font-size: 12px; font-weight: 600; }
.form-field label span { color: var(--text-muted); font-size: 10px; font-weight: 400; }
.form-field input, .form-field select, .form-field textarea, .settings-form input {
    width: 100%;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    outline: none;
    transition: border .18s, box-shadow .18s;
}
.form-field input, .form-field select, .settings-form input { height: 41px; padding: 9px 12px; }
.form-field textarea { min-height: 90px; padding: 10px 12px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus, .settings-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,183,126,.08); }
.form-field input::placeholder, .form-field textarea::placeholder { color: #b0b8c3; }
.form-field small, .credential-field small { display: block; margin-top: 6px; color: var(--text-muted); font-size: 10px; line-height: 1.6; }
.driver-description { margin-bottom: 18px; padding: 12px 14px; color: #44705e; background: var(--primary-soft); border: 1px solid #d9f1e7; border-radius: 11px; font-size: 11px; }
.file-control { display: flex; align-items: center; gap: 12px; }
.file-control input { height: auto; padding: 8px; }
.file-control input::file-selector-button { margin-right: 10px; padding: 6px 10px; color: var(--primary-dark); background: var(--primary-soft); border: 0; border-radius: 7px; cursor: pointer; }
.current-qr-image { width: 42px; height: 42px; object-fit: cover; border: 1px solid var(--line); border-radius: 7px; }
.detail-section + .detail-section { margin-top: 23px; }
.detail-section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.detail-section-title h3 { font-size: 14px; }
.detail-section-title span { color: var(--text-muted); font-size: 10px; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.detail-grid > div { min-width: 0; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.detail-grid > div:nth-child(odd) { border-right: 1px solid var(--line); }
.detail-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
.detail-grid dt { margin-bottom: 4px; color: var(--text-muted); font-size: 10px; }
.detail-grid dd { color: #344054; font-size: 12px; word-break: break-all; }
.timeline { position: relative; list-style: none; }
.timeline::before { position: absolute; left: 6px; top: 10px; bottom: 12px; width: 1px; background: var(--line-strong); content: ""; }
.timeline-item { position: relative; padding: 0 0 17px 25px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { position: absolute; left: 2px; top: 6px; z-index: 1; width: 9px; height: 9px; background: #fff; border: 2px solid var(--primary); border-radius: 50%; content: ""; }
.timeline-item strong { display: block; margin-bottom: 2px; color: #344054; font-size: 11px; }
.timeline-item p { color: var(--text-secondary); font-size: 11px; white-space: pre-wrap; word-break: break-word; }
.timeline-item time { display: block; margin-top: 3px; color: var(--text-muted); font-size: 9px; }
.response-block { max-height: 240px; margin: 0; padding: 14px; color: #d6e6f2; background: #1b2938; border-radius: 11px; overflow: auto; font-size: 10px; line-height: 1.7; white-space: pre-wrap; word-break: break-all; }
.image-preview { display: block; max-width: 100%; max-height: 65vh; margin: 0 auto; border-radius: 12px; }

/* Documentation */
.docs-hero { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 22px; padding: 30px 34px; color: #fff; background: linear-gradient(120deg, #3579da, #4a8ee8 55%, #40a9b4); border-radius: 22px; box-shadow: 0 16px 35px rgba(53,121,218,.13); }
.docs-hero h2 { margin-bottom: 8px; font-size: 25px; }
.docs-hero p { max-width: 600px; color: rgba(255,255,255,.75); font-size: 12px; }
.docs-hero-code { min-width: 260px; padding: 16px 18px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); border-radius: 14px; backdrop-filter: blur(10px); }
.docs-hero-code span { display: block; margin-bottom: 5px; color: rgba(255,255,255,.6); font-size: 9px; letter-spacing: 1px; }
.docs-hero-code code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.docs-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 22px; align-items: start; }
.docs-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.doc-card { padding: 25px; }
.doc-card-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 17px; }
.doc-card-heading > div { flex: 1; min-width: 0; }
.doc-card-heading h3 { margin-bottom: 4px; font-size: 16px; }
.doc-card-heading p, .doc-card-heading code { color: var(--text-muted); font-size: 11px; }
.doc-card-heading .copy-button { flex: 0 0 auto; }
.endpoint-method { display: inline-flex; justify-content: center; min-width: 78px; padding: 5px 8px; color: var(--primary-dark); background: var(--primary-soft); border-radius: 7px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.method-sign { min-width: 48px; color: var(--violet); background: var(--violet-soft); }
.doc-card > p { margin-bottom: 18px; color: var(--text-secondary); font-size: 12px; }
.doc-card > p code { padding: 2px 5px; color: var(--primary-dark); background: var(--primary-soft); border-radius: 4px; }
.doc-table { min-width: 520px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.doc-table th { padding: 10px 13px; color: var(--text-muted); background: var(--surface-soft); font-size: 10px; font-weight: 600; }
.doc-table td { padding: 10px 13px; color: var(--text-secondary); border-top: 1px solid var(--line); font-size: 11px; }
.doc-table td:first-child { width: 135px; }
.doc-table td:nth-child(2) { width: 65px; }
.doc-table code { color: #3663a1; }
.parameter-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.parameter-chips span { padding: 5px 9px; color: #526377; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 7px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; }
.sign-steps { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; list-style: none; }
.sign-steps li { display: flex; align-items: flex-start; gap: 11px; }
.sign-steps li > span { display: grid; place-items: center; flex: 0 0 auto; width: 23px; height: 23px; margin-top: 1px; color: var(--primary-dark); background: var(--primary-soft); border-radius: 7px; font-size: 10px; font-weight: 700; }
.sign-steps p { color: var(--text-secondary); font-size: 11px; line-height: 1.9; }
.sign-steps code { padding: 1px 4px; color: #426588; background: #f0f4f8; border-radius: 4px; }
.code-block { margin: 0; padding: 16px 18px; color: #d7e5ee; background: #1d2c3a; border-radius: 12px; overflow-x: auto; font-size: 10px; line-height: 1.8; }
.docs-aside { display: flex; flex-direction: column; gap: 18px; }
.credential-card, .notify-card, .doc-help-card { padding: 22px; }
.credential-card h3 { margin-bottom: 17px; font-size: 16px; }
.credential-card dl > div { padding: 12px 0; border-top: 1px solid var(--line); }
.credential-card dt { margin-bottom: 5px; color: var(--text-muted); font-size: 10px; }
.credential-card dd { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.credential-card dd code { min-width: 0; overflow: hidden; color: #344054; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.security-note { display: flex; align-items: flex-start; gap: 7px; margin-top: 12px; padding: 10px; color: #8a6a3a; background: var(--orange-soft); border-radius: 9px; font-size: 10px; }
.security-note .icon { width: 15px; height: 15px; margin-top: 1px; }
.notify-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; color: var(--blue); background: var(--blue-soft); border-radius: 12px; }
.notify-card h3, .doc-help-card h3 { margin-bottom: 10px; font-size: 15px; }
.notify-card p { color: var(--text-secondary); font-size: 11px; }
.notify-card pre { margin: 13px 0; padding: 13px; color: var(--primary-dark); background: var(--primary-soft); border: 1px dashed #bfe5d5; border-radius: 10px; text-align: center; font-size: 13px; font-weight: 700; }
.check-list { display: flex; flex-direction: column; gap: 11px; margin: 15px 0 19px; list-style: none; }
.check-list li { position: relative; padding-left: 19px; color: var(--text-secondary); font-size: 11px; }
.check-list li::before { position: absolute; left: 0; top: 4px; width: 12px; height: 12px; background: var(--primary); border-radius: 50%; content: ""; }
.check-list li::after { position: absolute; left: 4px; top: 8px; width: 4px; height: 2px; border-bottom: 1.5px solid #fff; border-left: 1.5px solid #fff; content: ""; transform: rotate(-45deg); }

/* Settings */
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; align-items: start; }
.settings-card { padding: 26px; }
.settings-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }
.settings-heading h2 { margin-bottom: 5px; font-size: 17px; }
.settings-heading p { color: var(--text-secondary); font-size: 11px; }
.settings-icon { display: grid; place-items: center; flex: 0 0 auto; width: 43px; height: 43px; border-radius: 13px; }
.settings-icon .icon { width: 20px; height: 20px; }
.settings-icon.green { color: var(--primary); background: var(--primary-soft); }
.settings-icon.blue { color: var(--blue); background: var(--blue-soft); }
.settings-icon.violet { color: var(--violet); background: var(--violet-soft); }
.settings-form { display: flex; flex-direction: column; gap: 18px; }
.settings-form .form-field label { font-size: 12px; }
.settings-form input { background: #fbfcfd; }
.form-actions { display: flex; justify-content: flex-end; padding-top: 4px; }
.credential-field { margin-bottom: 20px; }
.credential-control { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 9px 8px 13px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; }
.credential-control code { flex: 1; min-width: 0; overflow: hidden; color: #344054; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.masked-value { letter-spacing: 1px; }
.danger-soft-box { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 24px; padding: 16px; background: #fff8f8; border: 1px solid #ffe6e8; border-radius: 12px; }
.danger-soft-box strong { display: block; margin-bottom: 4px; color: #9c4049; font-size: 12px; }
.danger-soft-box p { color: #a97479; font-size: 10px; }
.security-settings-card { grid-column: 1/-1; }
.password-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: start; }
.password-form .form-actions { grid-column: 1/-1; }

/* Toasts and noscript */
.toast-region { position: fixed; right: 24px; top: 24px; z-index: 150; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; width: min(360px,calc(100vw - 32px)); padding: 13px 15px; color: #344054; background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 14px 40px rgba(30,45,65,.14); backdrop-filter: blur(14px); pointer-events: auto; animation: toast-in .25s ease both; }
.toast.leaving { animation: toast-out .2s ease both; }
.toast-icon { display: grid; place-items: center; flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px; color: var(--primary); background: var(--primary-soft); border-radius: 7px; font-size: 12px; font-weight: 700; }
.toast.error .toast-icon { color: var(--red); background: var(--red-soft); }
.toast.warning .toast-icon { color: var(--orange); background: var(--orange-soft); }
.toast-message { flex: 1; font-size: 12px; line-height: 1.7; word-break: break-word; }
.toast-close { padding: 0 2px; color: var(--text-muted); background: none; border: 0; font-size: 18px; line-height: 1.2; }
.noscript-notice { position: fixed; left: 50%; bottom: 20px; z-index: 200; padding: 12px 20px; color: #fff; background: #c64450; border-radius: 10px; box-shadow: var(--shadow-md); transform: translateX(-50%); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(18px); } }

@media (min-width: 1500px) {
    .channels-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 1200px) {
    :root { --sidebar-width: 224px; }
    .sidebar { padding-left: 14px; padding-right: 14px; }
    .nav-item::before { left: -14px; }
    .content, .topbar { padding-left: 25px; padding-right: 25px; }
    .stats-grid { gap: 13px; }
    .stat-card { padding: 19px; }
    .stat-card > strong { font-size: 24px; }
    .overview-grid { grid-template-columns: minmax(0,1fr) 285px; gap: 18px; }
    .welcome-banner { padding: 30px; }
    .welcome-visual { width: 250px; flex-basis: 250px; }
    .docs-layout { grid-template-columns: minmax(0,1fr) 270px; gap: 18px; }
    .doc-card { padding: 21px; }
    .login-shell { grid-template-columns: minmax(380px,.9fr) minmax(450px,1.1fr); }
    .login-intro { padding-left: 45px; padding-right: 45px; }
}

@media (max-width: 1000px) {
    .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
    .overview-grid { grid-template-columns: 1fr; }
    .merchant-overview-card { display: grid; grid-template-columns: 1fr 1fr; padding: 22px; column-gap: 25px; }
    .merchant-overview-card .card-header { grid-column: 1/-1; padding: 0 0 18px; }
    .merchant-summary { padding: 0; }
    .compact-details { margin: 0; }
    .merchant-overview-card > .button { grid-column: 2; width: 100%; margin: 12px 0 0; }
    .channels-grid { grid-template-columns: 1fr; }
    .docs-layout { grid-template-columns: 1fr; }
    .docs-aside { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
    .settings-grid { gap: 17px; }
    .settings-card { padding: 22px; }
    .password-form { grid-template-columns: 1fr; }
    .password-form .form-actions { grid-column: auto; }
}

@media (max-width: 900px) {
    .app-shell { display: block; }
    .sidebar { display: none; }
    .topbar { min-height: 78px; padding: 15px 22px; }
    .topbar-heading h1 { font-size: 19px; }
    .topbar-heading p, .topbar-kicker { display: none; }
    .account-chip { margin-right: 0; padding-right: 12px; }
    .account-chip div { display: none; }
    .mobile-logout { display: inline-flex; }
    .mobile-nav { position: sticky; top: 78px; z-index: 29; display: flex; gap: 4px; padding: 9px 17px; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); overflow-x: auto; scrollbar-width: none; }
    .mobile-nav::-webkit-scrollbar { display: none; }
    .mobile-nav-item { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; min-height: 36px; padding: 7px 12px; color: var(--text-secondary); background: transparent; border: 0; border-radius: 10px; font-size: 11px; white-space: nowrap; }
    .mobile-nav-item .icon { width: 15px; height: 15px; }
    .mobile-nav-item.active { color: var(--primary-dark); background: var(--primary-soft); font-weight: 650; }
    .content { padding: 23px 22px 32px; }
    .app-footer { padding: 0 22px 20px; }
    .welcome-banner { min-height: 225px; }
    .welcome-visual { width: 220px; flex-basis: 220px; }
    .visual-card { right: 0; }
    .docs-aside { grid-template-columns: 1fr 1fr; }
    .doc-help-card { grid-column: 1/-1; }
    .settings-grid { grid-template-columns: 1fr; }
    .security-settings-card { grid-column: auto; }
    .password-form { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .password-form .form-actions { grid-column: 1/-1; }
    .login-shell { grid-template-columns: minmax(320px,.85fr) minmax(400px,1.15fr); }
    .login-intro { padding: 35px; }
    .intro-copy h1 { font-size: 42px; }
    .intro-feature-grid { grid-template-columns: 1fr; }
    .intro-feature { padding: 13px; }
    .login-panel { padding: 40px; }
}

@media (max-width: 720px) {
    .login-shell { display: block; }
    .login-intro { display: none; }
    .login-panel { min-height: 100vh; padding: 35px 24px; background: radial-gradient(circle at 100% 0%, #def7ed, transparent 40%), radial-gradient(circle at 0% 100%, #edf4ff, transparent 38%), #fff; }
    .login-card { max-width: 430px; padding: 30px; background: rgba(255,255,255,.82); border: 1px solid rgba(255,255,255,.9); border-radius: 23px; box-shadow: var(--shadow-md); backdrop-filter: blur(16px); }
    .mobile-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 35px; font-size: 19px; font-weight: 750; }
    .welcome-visual { display: none; }
    .welcome-banner { min-height: 0; padding: 28px; }
    .welcome-copy h2 { font-size: 25px; }
    .driver-guide { grid-template-columns: 1fr; padding: 13px 18px; }
    .driver-guide > div { padding: 10px 0; border-right: 0; border-bottom: 1px solid var(--line); }
    .driver-guide > div:last-child { border-bottom: 0; }
    .docs-hero { align-items: flex-start; flex-direction: column; padding: 26px; }
    .docs-hero-code { width: 100%; min-width: 0; }
    .password-form { grid-template-columns: 1fr; }
    .password-form .form-actions { grid-column: auto; }
    .modal { padding: 16px; }
    .modal-dialog { max-height: calc(100vh - 32px); border-radius: 19px; }
}

@media (max-width: 560px) {
    .topbar { min-height: 64px; padding: 13px 16px; }
    .topbar-actions { gap: 7px; }
    .account-chip { display: none; }
    .icon-button { width: 36px; height: 36px; border-radius: 10px; }
    .mobile-nav { top: 64px; padding-left: 11px; padding-right: 11px; }
    .content { padding: 17px 14px 28px; }
    .app-footer { padding: 0 16px 18px; }
    .welcome-banner { padding: 24px 21px; border-radius: 20px; }
    .welcome-copy h2 { font-size: 23px; }
    .welcome-copy > p { font-size: 12px; }
    .welcome-actions { align-items: stretch; flex-direction: column; margin-top: 22px; }
    .welcome-actions .button { width: 100%; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 11px; }
    .stat-card { padding: 16px; border-radius: 16px; }
    .stat-top { margin-bottom: 9px; font-size: 10px; }
    .stat-icon { width: 27px; height: 27px; }
    .stat-card > strong { font-size: 21px; }
    .stat-caption { font-size: 9px; }
    .card { border-radius: 17px; }
    .card-header, .list-toolbar { padding: 19px; }
    .merchant-overview-card { display: block; padding: 20px; }
    .merchant-overview-card .card-header { padding: 0 0 17px; }
    .merchant-summary { padding-bottom: 18px; }
    .compact-details { margin-bottom: 15px; }
    .merchant-overview-card > .button { margin-top: 0; }
    .list-toolbar { align-items: flex-start; flex-direction: column; gap: 15px; }
    .list-toolbar .button { width: 100%; }
    .filter-bar { align-items: stretch; margin: 0 15px 16px; padding: 11px; }
    .search-field { flex-basis: 100%; min-width: 0; }
    .filter-bar select { flex: 1; min-width: 0; }
    .filter-bar .button-plain { padding-left: 10px; padding-right: 10px; }
    .data-table th:first-child, .data-table td:first-child { padding-left: 18px; }
    .data-table th:last-child, .data-table td:last-child { padding-right: 18px; }
    .table-meta { align-items: flex-start; flex-direction: column; padding: 15px 18px; }
    .pagination { width: 100%; justify-content: flex-end; }
    .section-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
    .section-heading .button { width: 100%; }
    .section-heading h2 { font-size: 21px; }
    .channel-card { padding: 18px; }
    .channel-meta { gap: 8px; }
    .channel-card-actions { flex-wrap: wrap; }
    .channel-card-actions .button:first-child { width: 100%; margin-right: 0; }
    .docs-hero { padding: 23px 21px; }
    .docs-hero h2 { font-size: 22px; }
    .doc-card { padding: 18px; }
    .doc-card-heading { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
    .doc-card-heading .copy-button { margin-left: auto; }
    .endpoint-method { min-width: 65px; }
    .docs-aside { grid-template-columns: 1fr; }
    .doc-help-card { grid-column: auto; }
    .settings-card { padding: 20px; }
    .settings-heading { align-items: flex-start; }
    .danger-soft-box { align-items: flex-start; flex-direction: column; }
    .danger-soft-box .button { width: 100%; }
    .credential-control { flex-wrap: wrap; }
    .credential-control code { flex-basis: 100%; padding: 3px 0 6px; }
    .form-actions .button { width: 100%; }
    .modal { padding: 0; place-items: end center; }
    .modal-dialog, .modal-dialog.modal-wide { width: 100%; max-height: 92vh; border-radius: 21px 21px 0 0; animation-name: modal-mobile-in; }
    .modal-header { padding: 20px 19px 16px; }
    .modal-body { padding: 20px 19px; }
    .modal-footer { padding: 14px 19px calc(14px + env(safe-area-inset-bottom)); }
    .channel-form-grid, .detail-grid { grid-template-columns: 1fr; }
    .detail-grid > div:nth-child(odd) { border-right: 0; }
    .detail-grid > div:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
    .detail-grid > div:last-child { border-bottom: 0; }
    .modal-footer .button { flex: 1; }
    .toast-region { left: 16px; right: 16px; top: 16px; align-items: stretch; }
    .toast { width: 100%; }
    .login-card { padding: 25px 22px; }
    @keyframes modal-mobile-in { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
