:root {
  --brand-red: #e52b3a;
  --brand-ruby: #b9162a;
  --signal-amber: #f59e0b;
  --signal-green: #22a06b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f4f7fb;
  background: #09111f;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(900px 520px at 5% -10%, #17395a 0%, transparent 62%), radial-gradient(700px 420px at 100% 0%, #17342f 0%, transparent 58%), #09111f;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, input, select, textarea { transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease; }
.shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 30px 0 56px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 38px; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; font-size: 1rem; font-weight: 760; letter-spacing: -.025em; }
.brand-logo { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; object-fit: cover; object-position: center; background: #050505; }
.mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #82f3d7; border-radius: 12px; color: #06141b; background: linear-gradient(145deg, #9af6dd, #46c6aa); box-shadow: 0 8px 24px #45c4a347; font-weight: 900; }
.muted { color: #93a4ba; font-size: .88rem; line-height: 1.5; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -.055em; }
h2 { margin-bottom: 5px; font-size: 1.05rem; letter-spacing: -.02em; }
.lead { margin-bottom: 29px; color: #a9b8ca; line-height: 1.55; }
.dashboard-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 28px; }
.role { display: inline-flex; align-items: center; min-height: 29px; padding: 5px 10px; border: 1px solid #2f776c; border-radius: 999px; color: #a3f3dc; background: #123b37; font-size: .74rem; font-weight: 760; letter-spacing: .02em; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(450px, 100%); padding: 38px; border: 1px solid #2c3e58; border-radius: 24px; background: linear-gradient(150deg, #17243aee, #101a2cee); box-shadow: 0 26px 90px #000a, inset 0 1px #ffffff0f; }
.login-card .brand { padding-bottom: 2px; }
.form { display: grid; gap: 15px; }
label { display: grid; gap: 7px; color: #b7c5d7; font-size: .82rem; font-weight: 600; }
input, select, textarea { width: 100%; padding: 12px 13px; border: 1px solid #34455e; border-radius: 10px; color: #eff6ff; outline: none; background: #0e1829; }
input::placeholder, textarea::placeholder { color: #65768e; }
input:hover, select:hover, textarea:hover { border-color: #526783; }
input:focus, select:focus, textarea:focus { border-color: #62d5ba; box-shadow: 0 0 0 4px #58cdb31d; }
textarea { min-height: 96px; resize: vertical; }
.button { min-height: 42px; padding: 10px 16px; border: 1px solid transparent; border-radius: 10px; color: #06211d; background: linear-gradient(135deg, #91f1d6, #55d2b6); box-shadow: 0 7px 18px #36be9a2b; font-weight: 760; }
.button:hover { background: linear-gradient(135deg, #b0f8e3, #65ddc0); transform: translateY(-1px); box-shadow: 0 10px 22px #36be9a3e; }
.button:active { transform: translateY(0); }
.button.ghost { color: #cad7e8; border-color: #35475f; background: #16223699; box-shadow: none; }
.button.ghost:hover { color: #fff; border-color: #647b99; background: #202f48; }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card { padding: 21px; border: 1px solid #293b55; border-radius: 17px; background: linear-gradient(145deg, #16233ae8, #101a2be8); box-shadow: inset 0 1px #ffffff0b, 0 10px 32px #00000012; }
.grid .card { min-height: 132px; display: flex; flex-direction: column; justify-content: center; }
.metric { margin-top: 10px; color: #fff; font-size: clamp(1.55rem, 3vw, 2rem); font-weight: 760; line-height: 1; letter-spacing: -.055em; }
.content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.menu { display: flex; gap: 4px; flex-wrap: wrap; width: fit-content; max-width: 100%; margin: 0 0 22px; padding: 5px; border: 1px solid #293b55; border-radius: 12px; background: #101a2bc4; }
.menu button { padding: 9px 12px; border: 1px solid transparent; border-radius: 8px; color: #9baac0; background: transparent; font-size: .86rem; font-weight: 650; }
.menu button:hover { color: #d9fff5; background: #173d39; }
.menu button.active { border-color: #358f7e; color: #d9fff5; background: linear-gradient(135deg, #1d5048, #173d3d); box-shadow: inset 0 1px #9ff5dd24; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 19px; }
.actions .button { min-width: 146px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-title h2 { margin: 0; }
.stack { display: grid; gap: 3px; }
.row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid #273851; }
.bank-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bank-icon { width: 36px; height: 36px; flex: 0 0 36px; object-fit: contain; border-radius: 9px; background: #fff; padding: 3px; }
.bank-icon-empty { display: inline-grid; place-items: center; box-sizing: border-box; border: 1px solid #3b4d68; color: #9caec6; background: #202e45; font-weight: 700; }
.bank-picker { display: flex; align-items: center; gap: 8px; }
.bank-picker input { min-width: 0; }
.bank-picker .bank-icon { width: 30px; height: 30px; flex-basis: 30px; }
.request-load { margin-top: 16px; }
.load-table { display: grid; gap: 6px; }
.load-head, .load-row { display: grid; grid-template-columns: 145px repeat(4, minmax(100px, 1fr)); gap: 14px; align-items: center; }
.load-head { color: #91a1b9; font-size: 12px; padding: 0 12px 8px; }
.load-row { background: #1b2940; border-radius: 10px; min-height: 42px; padding: 0 12px; font-size: 13px; }
.load-cell { display: flex; align-items: center; gap: 7px; }
.load-count { width: 16px; text-align: right; color: #dbe6f5; font-variant-numeric: tabular-nums; }
.load-track { flex: 1; height: 7px; border-radius: 99px; background: #31415b; overflow: hidden; }
.load-bar { display: block; height: 100%; min-width: 0; border-radius: inherit; }
.load-bar.low { background: var(--signal-green); }.load-bar.medium { background: var(--signal-amber); }.load-bar.high { background: var(--brand-red); }
@media (max-width: 760px) { .load-head, .load-row { grid-template-columns: 120px repeat(4, minmax(78px, 1fr)); gap: 8px; } .load-row { padding: 0 8px; } }
.row:first-child { padding-top: 0; border-top: 0; }
.row:last-child { padding-bottom: 0; }
.row strong { color: #eef5ff; font-size: .92rem; }
.deal-list { display: grid; gap: 8px; }
.deal-card { display: grid; grid-template-columns: 300px 250px 160px minmax(180px, 1fr) 108px 54px; gap: 14px; align-items: center; padding: 12px; border: 1px solid #273851; border-radius: 11px; background: #17243a; }
.deal-state, .deal-bank { display: flex; align-items: center; gap: 10px; min-width: 0; }
.deal-state { align-items: flex-start; }
.deal-card strong, .deal-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-card strong { color: #eef5ff; font-size: .83rem; }.deal-card small { margin-top: 3px; color: #9caec6; font-size: .72rem; }
.deal-state-icon { display: inline-grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; margin-top: 1px; border: 1px solid currentColor; border-radius: 50%; font-weight: 800; line-height: 1; }
.deal-state.success, .deal-result.success { color: var(--signal-green); }.deal-state.failed, .deal-result.failed { color: #ff8f9a; }.deal-state.pending, .deal-result.pending { color: var(--signal-amber); }
.deal-bank .bank-icon { width: 30px; height: 30px; flex-basis: 30px; }
.deal-amount, .deal-counterparty { min-width: 0; }.deal-result { width: 108px; box-sizing: border-box; padding: 7px 6px; border-radius: 7px; background: #24334a; text-align: center; font-size: .73rem; font-weight: 750; white-space: nowrap; }
.deal-dispute { width: 54px; min-width: 54px !important; padding: 7px 0; font-size: .75rem; }
.requisite-operations { display: grid; gap: 4px; }
.requisite-operation { display: grid; grid-template-columns: 1.3fr .7fr .9fr 1fr; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid #273851; }
.requisite-operation strong, .requisite-operation small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.requisite-operation strong { color: #eef5ff; font-size: .8rem; }.requisite-operation small { margin-top: 3px; color: #9caec6; font-size: .72rem; }
.requisite-operation .bank-icon { width: 28px; height: 28px; flex-basis: 28px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; color: #9caec6; font-size: .78rem; }
.pagination .button { min-width: auto; padding: 7px 10px; }.pagination .button:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 1180px) { .deal-card { grid-template-columns: 1.2fr 1fr .72fr .85fr 108px 54px; gap: 10px; } }
@media (max-width: 980px) { .deal-card { grid-template-columns: 1fr 1fr 1fr; } .deal-dispute { justify-self: start; } }
@media (max-width: 620px) { .deal-card { grid-template-columns: 1fr 1fr; gap: 11px; } .deal-result { justify-self: start; } }
.status { display: inline-flex; align-items: center; justify-content: center; padding: 5px 8px; border: 1px solid #735e2d; border-radius: 999px; color: var(--signal-amber); background: #4a3b1d; font-size: .72rem; font-weight: 750; white-space: nowrap; }
.status.expired { border-color: #783746; color: #ffc5cd; background: #502630; }
.status.online { border-color: #2e805d; color: #a4f4cb; background: #173f30; }
.status.offline, .status.never-connected { border-color: #5c6373; color: #c3cad7; background: #292e38; }
.empty { padding: 30px 0; color: #8e9eb4; text-align: center; }
.notice { margin: 12px 0; padding: 11px 12px; border: 1px solid #783d4b; border-radius: 10px; color: #ffd6da; background: #4a2530; font-size: .88rem; }

.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 18px; background: #020914ba; backdrop-filter: blur(7px); }
.modal { width: min(450px, 100%); padding: 26px; border: 1px solid #3a506e; border-radius: 20px; background: #111d30; box-shadow: 0 32px 100px #000c, inset 0 1px #ffffff0c; }
.requisites-modal { width: min(940px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; }
.requisite-section { display: grid; gap: 14px; padding: 17px; border: 1px solid #2a3b54; border-radius: 13px; background: #18243a; }
.form-row, .limit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row label:last-child { grid-column: 1 / -1; }
.toggles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.switch-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #c0cede; }
.form-actions { justify-content: space-between; margin-top: 0; }
.payment { width: min(640px, 100%); margin: 12px auto 0; }
.wallet { overflow-wrap: anywhere; margin: 15px 0; padding: 15px; border: 1px dashed #4e8d87; border-radius: 11px; color: #a9f5df; background: #0a1928; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; }
.deposit-qr { display: grid; justify-items: center; gap: 11px; margin: 18px 0; color: #a9b8cb; text-align: center; }
.deposit-qr img { width: 180px; height: 180px; padding: 9px; border-radius: 12px; background: #fff; }
.rate-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.rate-pill { display: inline-flex; padding: 7px 10px; border: 1px solid #2d846f; border-radius: 999px; color: #b8f4dc; background: #164438; font-size: .82rem; font-weight: 700; }
.metric small { display: block; margin-top: 8px; color: #93a4ba; font-size: .72rem; font-weight: 600; letter-spacing: 0; }
.requisite-detail { cursor: pointer; }
.requisite-summary { margin-top: 6px; font-size: .78rem; line-height: 1.45; }
.requisite-conversion { margin-top: 5px; color: #8de2ca; font-size: .78rem; font-weight: 650; }
.limit-list, .conversion { display: flex; flex-wrap: wrap; gap: 8px; }
.limit-list span, .conversion span { padding: 7px 9px; border-radius: 8px; color: #bed0e5; background: #0d1829; font-size: .83rem; }
.timer { margin: 15px 0; padding: 15px; border: 1px solid #745f31; border-radius: 11px; color: #f9d982; background: #372e1d; text-align: center; font-size: 1.3rem; font-weight: 760; letter-spacing: .04em; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.theme-button { width: 42px; min-width: 42px; padding: 0 !important; display: inline-grid; place-items: center; font-size: 1.12rem; line-height: 1; }
.online { min-height: 38px; padding: 8px 12px; border: 1px solid #67414c; border-radius: 10px; color: #f2bac1; background: #351f2a; font-size: .84rem; font-weight: 750; }
.online.on { border-color: #2c866f; color: #b8f4dc; background: #164438; box-shadow: 0 0 0 3px #1d967315; }
.filter-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 18px 0; }
.filter-form label { flex: 1 1 150px; }
.filter-form label:has(input[type="number"]) { flex-basis: 132px; }
.filter-form label:has(select[name="worker_id"]) { flex-basis: 190px; }
.worker-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }.worker-toolbar .filter-form { margin: 0; min-width: min(100%, 420px); }.worker-metrics { margin-bottom: 16px; }.worker-content { align-items: start; }.worker-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; padding: 14px 0; border: 0; border-top: 1px solid #303846; color: #eef5ff; background: transparent; text-align: left; }.worker-item:first-child { padding-top: 0; border-top: 0; }.worker-item strong, .worker-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.worker-item small { margin-top: 4px; color: #98a5b8; font-size: .75rem; }.worker-device { width: 100%; cursor: pointer; }.worker-device:hover { color: #fff; }.worker-queue { margin-top: 16px; }.light-theme .worker-item { border-color: #ebe3e5; color: #302b32; }.light-theme .worker-item small { color: #7f7378; }
.dispute-workspace { align-items: start; }.dispute-list { display: grid; gap: 10px; }.dispute-card { padding: 15px; border: 1px solid #35303a; border-radius: 14px; background: #17161a; }.dispute-card-head, .dispute-card-foot { display: flex; align-items: start; justify-content: space-between; gap: 12px; }.dispute-card-head strong, .dispute-card-head small { display: block; }.dispute-card-head strong { color: #f4eef0; font-size: .9rem; }.dispute-card-head small, .dispute-card-foot { color: #9c9299; font-size: .73rem; }.dispute-card-head small { margin-top: 4px; }.dispute-card p { margin: 13px 0; color: #dbd2d6; font-size: .84rem; line-height: 1.5; }.dispute-card-foot { padding-top: 11px; border-top: 1px solid #302c32; }.dispute-status.success { border-color: #317952; color: #bbefcf; background: #183625; }.dispute-status.failed { border-color: #7a3c48; color: #ffbec6; background: #3a2027; }.dispute-status.pending { border-color: #765b31; color: #f4d88e; background: #332a1b; }.dispute-form-card { position: sticky; top: 24px; }.light-theme .dispute-card { border-color: #e9dfe2; background: #fffafb; }.light-theme .dispute-card-head strong { color: #312c32; }.light-theme .dispute-card-head small, .light-theme .dispute-card-foot { color: #82757c; }.light-theme .dispute-card p { color: #514850; }.light-theme .dispute-card-foot { border-color: #efe7e9; }.light-theme .dispute-status.success { border-color: #b9dfc8; color: #23714c; background: #f0faf4; }.light-theme .dispute-status.failed { border-color: #efc5cb; color: #b13142; background: #fff2f3; }.light-theme .dispute-status.pending { border-color: #edd89f; color: #896414; background: #fff9e9; }
.team-workspace, .settings-workspace { align-items: start; }.employee-list { display: grid; gap: 9px; }.employee-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 14px; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid #35303a; border-radius: 14px; color: #f4eef0; background: #17161a; text-align: left; transition: border-color .16s ease, background .16s ease, transform .16s ease; }.employee-card:hover { border-color: #8d4050; background: #21191d; transform: translateY(-1px); }.employee-avatar, .setting-mark { display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: #ffe7ea; background: linear-gradient(135deg, #ce3144, #7e1f31); font-weight: 800; }.employee-avatar { width: 38px; height: 38px; }.employee-card-body { min-width: 0; }.employee-card-body strong, .employee-card-body small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.employee-card-body strong { font-size: .88rem; }.employee-card-body small { margin-top: 4px; color: #9c9299; font-size: .74rem; }.employee-chevron { color: #bba7ac; font-size: 1.35rem; line-height: 1; }.invite-card { position: sticky; top: 24px; }.settings-workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }.setting-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: start; gap: 13px; }.setting-card h2, .security-card h2 { margin: 0; font-size: 1rem; }.setting-card p { margin: 6px 0 0; }.setting-mark { width: 42px; height: 42px; font-size: 1.15rem; }.setting-card-action { grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 6px; }.setting-card-action .switch-line { padding: 0; border: 0; background: transparent; }.security-card { grid-column: 1 / -1; }.compact-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; }.compact-form .button { height: 42px; }.light-theme .employee-card { border-color: #e9dfe2; color: #312c32; background: #fffafb; }.light-theme .employee-card:hover { border-color: #d68793; background: #fff4f5; }.light-theme .employee-card-body small { color: #82757c; }.light-theme .employee-chevron { color: #ad7f87; }
@media (max-width: 820px) { .worker-toolbar { display: grid; align-items: stretch; }.worker-toolbar .filter-form { min-width: 0; } }
@media (max-width: 820px) { .dispute-form-card, .invite-card { position: static; }.settings-workspace { grid-template-columns: 1fr; }.security-card { grid-column: auto; }.compact-form { grid-template-columns: 1fr; } }
.chart { display: flex; align-items: end; gap: 14px; min-height: 230px; padding-top: 22px; overflow-x: auto; }
.chart-item { min-width: 94px; display: grid; gap: 6px; align-items: end; color: #aab9cb; text-align: center; font-size: .76rem; }
.chart-bar { width: 100%; min-height: 8px; background: linear-gradient(180deg, #91f1d6, #349b88); border-radius: 8px 8px 3px 3px; box-shadow: 0 0 18px #4dc9ac24; }
.stats-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: 6px 0 14px; color: #b4c3d6; font-size: .84rem; }
.stats-legend span { display: inline-flex; align-items: center; gap: 7px; }
.stats-legend i { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
.line-chart-scroll { overflow-x: auto; padding-bottom: 4px; }
.line-chart { display: block; min-width: 700px; width: 100%; height: 330px; overflow: visible; }
.line-grid { stroke: #31435e; stroke-width: 1; stroke-dasharray: 3 5; }
.line-y-label, .line-x-label { fill: #9dafc6; font-size: 12px; font-family: inherit; }
.line-y-label { text-anchor: end; }
.line-x-label { text-anchor: middle; }
.line-path { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 4px #0006); }
.line-dot { stroke: #15243a; stroke-width: 3; transition: r .15s ease; }
.line-dot:hover { r: 7; }
.employee-row { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 15px 0; border: 0; border-top: 1px solid #273851; color: #e4eefc; text-align: left; background: transparent; }
.employee-row:hover { color: #a9f5df; }
.employee-row span { display: grid; gap: 3px; }
.employee-row small { color: #93a4ba; }
.check { display: flex; grid-template-columns: none; align-items: center; gap: 9px; }
.check input { width: auto; }
.switch { display: inline-flex; width: 46px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span { width: 46px; height: 26px; position: relative; border-radius: 999px; background: #5b687c; transition: .18s ease; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .18s ease; }
.switch input:checked + span { background: #2eaa8d; }
.switch input:checked + span::after { transform: translateX(20px); }

html:has(body.light-theme) { background: #eff4fa; }
body.light-theme { color: #17243a; background: radial-gradient(900px 520px at 5% -10%, #d8ebff 0%, transparent 60%), #eff4fa; }
.light-theme .brand, .light-theme .employee-row, .light-theme .row strong, .light-theme .metric { color: #17243a; }
.light-theme .card, .light-theme .login-card, .light-theme .modal { border-color: #d5e0ed; background: linear-gradient(145deg, #ffffff, #f8fbff); box-shadow: 0 10px 30px #4b6c8e12; }
.light-theme .requisite-section { border-color: #dce6f0; background: #f4f8fc; }
.light-theme .modal-backdrop { background: #17243a80; }
.light-theme input, .light-theme select, .light-theme textarea { color: #17243a; border-color: #c8d6e5; background: #fff; }
.light-theme label, .light-theme .lead, .light-theme .chart-item { color: #51637d; }
.light-theme .muted, .light-theme .employee-row small { color: #64748f; }
.light-theme .button.ghost { color: #334966; border-color: #c5d3e2; background: #fff; }
.light-theme .menu { border-color: #d5e0eb; background: #ffffffc9; }
.light-theme .menu button { color: #60718a; }
.light-theme .menu button:hover, .light-theme .menu button.active { color: #125f52; border-color: #82cabc; background: #e3f7f0; }
.light-theme .role { border-color: #a5ddd1; color: #116154; background: #dcf7ef; }
.light-theme .online { color: #a54252; border-color: #e1bbc3; background: #fff1f3; }
.light-theme .online.on { color: #116154; border-color: #91cebf; background: #e0f6ef; }
.light-theme .wallet { color: #126b5c; border-color: #8bc6bd; background: #effbf7; }
.light-theme .timer { color: #8a5a00; border-color: #f0d994; background: #fff6dc; }
.light-theme .row, .light-theme .employee-row { border-color: #dce5ef; }
.light-theme .status { border-color: #eed28a; color: #7c5700; background: #fff3cf; }
.light-theme .status.expired { border-color: #efc0c7; color: #9a3344; background: #ffe8ec; }
.light-theme .notice { border-color: #efc2c8; color: #922e3d; background: #ffe9ec; }
.light-theme .chart-bar { background: linear-gradient(180deg, #47c1a5, #208977); }
.light-theme .line-grid { stroke: #d6e0ec; }
.light-theme .line-y-label, .light-theme .line-x-label { fill: #64748b; }
.light-theme .line-dot { stroke: #fff; }
.light-theme .switch span { background: #b6c2d3; }
.light-theme .requisite-conversion { color: #08725f; }

@media (max-width: 840px) { .grid { grid-template-columns: repeat(2, 1fr); } .content { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .shell { width: min(100% - 28px, 1240px); padding-top: 18px; } .topbar { align-items: flex-start; margin-bottom: 28px; } .top-actions { flex-wrap: wrap; justify-content: flex-end; } .dashboard-head { margin-bottom: 20px; } .login-card { padding: 27px; border-radius: 20px; } .form-row, .limit-grid, .toggles { grid-template-columns: 1fr; } .row { align-items: flex-start; } }
@media (max-width: 480px) { .grid { grid-template-columns: 1fr; } .topbar { gap: 12px; } .brand { font-size: .9rem; } .mark { width: 34px; height: 34px; } .top-actions { gap: 5px; } .top-actions .online { font-size: 0; min-width: 39px; padding: 8px; } .top-actions .online::first-letter { font-size: .92rem; } .menu { width: 100%; overflow-x: auto; flex-wrap: nowrap; } .menu button { white-space: nowrap; } .actions .button { flex: 1 1 auto; } }

/* Fontrade light — white workspace with a precise red action accent. */
body.light-theme {
  color: #24242b;
  background:
    radial-gradient(760px 420px at 100% -10%, #ffe7e9 0%, transparent 63%),
    radial-gradient(620px 340px at -8% 20%, #f7f8fb 0%, transparent 68%),
    #f7f7f8;
}
.light-theme .shell { width: min(1320px, calc(100% - 56px)); padding-top: 20px; }
.light-theme .topbar {
  min-height: 66px;
  margin-bottom: 42px;
  padding: 9px 10px 9px 18px;
  border: 1px solid #e5e1e3;
  border-radius: 18px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 12px 30px rgba(52, 30, 33, .045);
  backdrop-filter: blur(16px);
}
.light-theme .brand { color: #27252a; font-size: 1.02rem; letter-spacing: -.035em; }
.light-theme .mark {
  width: 38px; height: 38px; border: 0; border-radius: 12px;
  color: #fff; background: linear-gradient(135deg, #f43b45, #c91526);
  box-shadow: 0 7px 16px rgba(215, 27, 44, .25);
}
.light-theme h1 { color: #222126; font-size: clamp(2.05rem, 4.5vw, 3.35rem); letter-spacing: -.065em; }
.light-theme h2 { color: #29272d; font-size: 1.08rem; }
.light-theme .muted, .light-theme .employee-row small { color: #818087; }
.light-theme .lead, .light-theme label, .light-theme .chart-item { color: #68666e; }
.light-theme .dashboard-head { margin-bottom: 26px; }
.light-theme .role {
  border-color: #f4c7cc; color: #c91f2d; background: #fff1f2;
  font-weight: 720;
}
.light-theme .card, .light-theme .login-card, .light-theme .modal {
  border: 1px solid #e8e5e7;
  border-radius: 20px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 14px 34px rgba(42, 29, 31, .045), inset 0 1px rgba(255, 255, 255, .9);
}
.light-theme .card { padding: 22px; }
.light-theme .grid { gap: 18px; }
.light-theme .grid .card { min-height: 144px; }
.light-theme .metric { color: #242329; font-size: clamp(1.65rem, 3vw, 2.18rem); }
.light-theme .content { gap: 18px; margin-top: 18px; }
.light-theme .menu {
  gap: 2px; margin-bottom: 24px; padding: 5px;
  border-color: #e8e4e6; border-radius: 14px; background: #fff;
  box-shadow: 0 8px 20px rgba(42, 29, 31, .035);
}
.light-theme .menu button { border-radius: 10px; color: #77747b; font-weight: 650; }
.light-theme .menu button:hover { color: #b91f2c; background: #fff3f4; }
.light-theme .menu button.active {
  border-color: #f1c4c9; color: #c51e2b;
  background: linear-gradient(135deg, #fff1f2, #ffe7e9);
  box-shadow: none;
}
.light-theme input, .light-theme select, .light-theme textarea {
  border-color: #e5e1e3; border-radius: 11px; color: #2b2930; background: #fff;
}
.light-theme input::placeholder, .light-theme textarea::placeholder { color: #aaa7ad; }
.light-theme input:hover, .light-theme select:hover, .light-theme textarea:hover { border-color: #d8a6ac; }
.light-theme input:focus, .light-theme select:focus, .light-theme textarea:focus {
  border-color: #df3040; box-shadow: 0 0 0 4px rgba(225, 42, 58, .11);
}
.light-theme .button {
  min-height: 43px; border-radius: 12px; color: #fff;
  background: linear-gradient(135deg, #ee3340, #d41629);
  box-shadow: 0 8px 18px rgba(210, 22, 39, .20);
}
.light-theme .button:hover {
  background: linear-gradient(135deg, #fa4350, #dc1729);
  box-shadow: 0 11px 22px rgba(210, 22, 39, .27);
}
.light-theme .button.ghost {
  color: #5d5961; border-color: #e5e1e3; background: #fff; box-shadow: none;
}
.light-theme .button.ghost:hover { color: #c91f2d; border-color: #f0b7bd; background: #fff6f6; }
.light-theme .row, .light-theme .employee-row { border-color: #efedef; }
.light-theme .row strong, .light-theme .employee-row, .light-theme .deal-card strong { color: #302d34; }
.light-theme .requisite-section { border-color: #ece8ea; background: #fbfafb; }
.light-theme .load-row, .light-theme .deal-card { border-color: #ece8ea; background: #fcfbfc; }
.light-theme .load-track { background: #eee9eb; }
.light-theme .load-bar.low { background: var(--signal-green); }
.light-theme .load-bar.medium { background: var(--signal-amber); }
.light-theme .load-bar.high, .light-theme .chart-bar { background: linear-gradient(180deg, #f65a64, var(--brand-ruby)); }
.light-theme .online { border-color: #efd4d6; color: #a8545d; background: #fff8f8; }
.light-theme .online.on { border-color: #c7dfd3; color: #23724f; background: #f0faf4; box-shadow: 0 0 0 3px rgba(62, 149, 103, .08); }
.light-theme .status { border-color: #f0d79d; color: #8a6516; background: #fff8e7; }
.light-theme .status.expired, .light-theme .notice { border-color: #f0c1c6; color: #ba2836; background: #fff1f2; }
.light-theme .wallet { border-color: #edc6cb; color: #a91e2d; background: #fff7f7; }
.light-theme .timer { border-color: #f1d89a; color: #876111; background: #fff9e8; }
.light-theme .rate-pill { border-color: #f2c4c9; color: #c21d2c; background: #fff1f2; }
.light-theme .deal-result { background: #f4f1f2; }
.light-theme .deal-state.success, .light-theme .deal-result.success { color: var(--signal-green); }
.light-theme .deal-state.failed, .light-theme .deal-result.failed { color: var(--brand-red); }
.light-theme .deal-state.pending, .light-theme .deal-result.pending { color: #ad7000; }
.light-theme .line-grid { stroke: #ebe6e8; }
.light-theme .line-y-label, .light-theme .line-x-label { fill: #918d94; }
.light-theme .line-dot { stroke: #fff; }
.light-theme .switch span { background: #c8c3c7; }
.light-theme .switch input:checked + span { background: #df2b3a; }
.light-theme .requisite-conversion { color: #bc2533; }
.light-theme .login { background: radial-gradient(520px 360px at 85% 10%, #ffe3e6 0%, transparent 70%), #f7f7f8; }
.light-theme .login-card { padding: 40px; }
@media (max-width: 620px) { .light-theme .shell { width: min(100% - 28px, 1320px); } .light-theme .topbar { margin-bottom: 28px; } }

/* Fontrade dark — the same red brand language, adapted for low-light work. */
body:not(.light-theme) {
  background:
    radial-gradient(820px 500px at 100% -15%, #481622 0%, transparent 62%),
    radial-gradient(680px 420px at -10% 10%, #25131a 0%, transparent 65%),
    #101013;
}
body:not(.light-theme) .topbar {
  min-height: 66px; padding: 9px 10px 9px 18px; margin-bottom: 42px;
  border-color: #3d3236; border-radius: 18px; background: rgba(28, 25, 28, .84);
  box-shadow: 0 14px 35px rgba(0, 0, 0, .18); backdrop-filter: blur(16px);
}
body:not(.light-theme) .mark {
  border: 0; color: #fff; background: linear-gradient(135deg, #f1404c, #b91122);
  box-shadow: 0 7px 16px rgba(224, 37, 55, .25);
}
body:not(.light-theme) .role { border-color: #7e3440; color: #ffc3c9; background: #442028; }
body:not(.light-theme) .card, body:not(.light-theme) .login-card, body:not(.light-theme) .modal {
  border-color: #393136; border-radius: 20px;
  background: linear-gradient(145deg, rgba(31, 28, 32, .96), rgba(22, 20, 23, .96));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18), inset 0 1px rgba(255, 255, 255, .035);
}
body:not(.light-theme) .card { padding: 22px; }
body:not(.light-theme) .grid, body:not(.light-theme) .content { gap: 18px; }
body:not(.light-theme) .menu { border-color: #393136; border-radius: 14px; background: #1a181b; }
body:not(.light-theme) .menu button:hover { color: #ffd6d9; background: #402027; }
body:not(.light-theme) .menu button.active {
  border-color: #8d3b46; color: #ffe1e3; background: linear-gradient(135deg, #63242e, #3e1c23);
}
body:not(.light-theme) input:focus, body:not(.light-theme) select:focus, body:not(.light-theme) textarea:focus {
  border-color: #e23a48; box-shadow: 0 0 0 4px rgba(226, 58, 72, .14);
}
body:not(.light-theme) .button { color: #fff; background: linear-gradient(135deg, #ed3a47, #c01528); box-shadow: 0 8px 18px rgba(211, 27, 45, .22); }
body:not(.light-theme) .button:hover { background: linear-gradient(135deg, #fa4855, #d31a2d); box-shadow: 0 11px 22px rgba(211, 27, 45, .30); }
body:not(.light-theme) .button.ghost:hover { color: #ffd7db; border-color: #7d4650; background: #332027; }
body:not(.light-theme) .online { border-color: #7d414a; color: #ffc0c7; background: #392028; }
body:not(.light-theme) .online.on { border-color: #2f8c62; color: #bcefd5; background: #163b2b; box-shadow: 0 0 0 3px rgba(34, 160, 107, .12); }
body:not(.light-theme) .rate-pill { border-color: #803a46; color: #ffd0d4; background: #45212a; }
body:not(.light-theme) .wallet { border-color: #76404a; color: #ffcbd0; background: #21171b; }
body:not(.light-theme) .switch input:checked + span { background: #dc2e3d; }
body:not(.light-theme) .chart-bar { background: linear-gradient(180deg, #f1535e, #bf1c2d); box-shadow: 0 0 18px rgba(226, 51, 68, .17); }
body:not(.light-theme) .requisite-conversion { color: #ffb2ba; }

/* Merchant workspace: navigation is kept separate from operational content. */
.merchant-workspace { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 34px; align-items: start; }
.sidebar { position: sticky; top: 24px; min-height: calc(100vh - 118px); display: flex; flex-direction: column; padding: 12px; border: 1px solid #e8e5e7; border-radius: 18px; background: rgba(255,255,255,.82); box-shadow: 0 12px 30px rgba(42,29,31,.04); }
.sidebar-account { display: grid; gap: 4px; padding: 10px 11px 18px; color: #28262c; font-size: .86rem; }
.sidebar-account span { overflow: hidden; color: #858189; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .menu { width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.sidebar .menu button { width: 100%; display: flex; align-items: center; min-height: 40px; padding: 9px 11px; text-align: left; }
.sidebar .sidebar-menu-bottom { margin-top: auto; padding-top: 13px; border-top: 1px solid #eeebed; }
.merchant-main { min-width: 0; }
.merchant-main .dashboard-head { min-height: 64px; margin-bottom: 22px; }
.merchant-main .dashboard-head h1 { font-size: clamp(1.8rem, 3.5vw, 2.45rem); }

/* Action hierarchy: red is the product accent, neutral supports, status colours stay semantic. */
.light-theme .button { border: 1px solid #d41629; border-radius: 9px; color: #fff; background: #d41629; box-shadow: none; }
.light-theme .button:hover { background: #ba1022; box-shadow: none; }
.light-theme .button.ghost { color: #59565e; border-color: #dfdcdf; background: #fff; }
.light-theme .button.ghost:hover { color: #232127; border-color: #c9c4c8; background: #f7f6f7; }
.light-theme .button[data-dispute], .light-theme [data-blacklist-remove], .light-theme [data-vip-reset] { color: #bd2937; border-color: #efc2c7; background: #fff; }
.light-theme .button[data-dispute]:hover, .light-theme [data-blacklist-remove]:hover, .light-theme [data-vip-reset]:hover { color: #fff; border-color: #c82d3b; background: #c82d3b; }

body:not(.light-theme) .sidebar { border-color: #393136; background: rgba(28,25,28,.86); box-shadow: 0 14px 34px rgba(0,0,0,.18); }
body:not(.light-theme) .sidebar-account { color: #f1edf0; }
body:not(.light-theme) .sidebar-account span { color: #a9a0a5; }
body:not(.light-theme) .sidebar .sidebar-menu-bottom { border-color: #3b3438; }
body:not(.light-theme) .button { border-color: #c91526; color: #fff; background: #d41629; box-shadow: none; }
body:not(.light-theme) .button:hover { background: #ed3a47; box-shadow: none; }
body:not(.light-theme) .button.ghost { color: #d5ced2; border-color: #4a4045; background: #242024; }
body:not(.light-theme) .button.ghost:hover { color: #fff; border-color: #65595f; background: #302a2e; }

@media (max-width: 820px) {
  .merchant-workspace { display: block; }
  .sidebar { position: static; min-height: auto; display: block; margin-bottom: 26px; padding: 8px; }
  .sidebar-account { display: none; }
  .sidebar .menu { display: flex; flex-wrap: wrap; gap: 3px; }
  .sidebar .menu button { width: auto; min-height: 36px; padding: 7px 10px; }
  .sidebar .sidebar-menu-bottom { margin-top: 8px; padding-top: 8px; border-top: 1px solid #eeebed; }
  .merchant-main .dashboard-head { min-height: 0; }
}

/* Reference dashboard treatment: dense, calm, and built for daily operations. */
.shell { width: min(1400px, calc(100% - 40px)); padding-top: 24px; }
.merchant-workspace { grid-template-columns: 230px minmax(0, 1fr); gap: 30px; }
.topbar { min-height: 48px; margin: 0 0 20px 260px !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.topbar .brand { display: none; }
.search-box { width: min(480px, 52vw); display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 15px; border: 1px solid #292f3c; border-radius: 13px; background: #141820; color: #8da2c1; }
.search-box input { height: 100%; padding: 0; border: 0; color: inherit; background: transparent; box-shadow: none !important; }
.search-box input:focus { border: 0; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.top-actions .theme-button { min-width: 44px; padding: 0; }
.logout-compact { padding: 9px 12px !important; }
.profile-button { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 5px 12px 5px 6px; border: 1px solid #292f3c; border-radius: 12px; color: #f5f7fb; background: #141820; font-weight: 700; }
.profile-button b { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: linear-gradient(135deg, #ff637d, #bb2344); font-size: .78rem; }
.sidebar { top: 24px; min-height: calc(100vh - 48px); padding: 0 18px 18px; border: 1px solid #292f3c; border-radius: 0 0 16px 16px; background: #101319; box-shadow: none; }
.sidebar .brand { display: flex; min-height: 76px; margin: 0 -18px 20px; padding: 0 25px; border-bottom: 0; }
.sidebar .brand > span:last-child { display: grid; gap: 2px; }
.sidebar .brand small { color: #8490a4; font-size: .68rem; font-weight: 500; letter-spacing: 0; }
.sidebar .brand-logo-frame { width: 42px; height: 42px; flex: 0 0 42px; overflow: hidden; border-radius: 12px; background: #050505; }
.sidebar .brand-logo { display: block; width: 100%; height: 100%; border-radius: 0; transform: scale(1.35); }
.sidebar .menu button { gap: 13px; min-height: 44px; border-radius: 10px; color: #bac4d4; font-size: .9rem; }
.sidebar .menu button i, .sidebar-icon { width: 18px; height: 18px; flex: 0 0 18px; color: #acb7c9; font-style: normal; text-align: center; }
.sidebar-icon svg { display: block; width: 100%; height: 100%; }
.sidebar .menu button.active { border: 1px solid #a5223d; color: #fff; background: linear-gradient(90deg, #411823, #24151b); }
.sidebar .menu button.active i, .sidebar .menu button.active .sidebar-icon { color: #fff; }
.sidebar .sidebar-menu-bottom { margin-top: 20px; }
.sidebar-status { display: grid; gap: 8px; margin-top: 24px; padding: 14px; border: 1px solid #303746; border-radius: 13px; color: #b7c3d5; background: #171b23; font-size: .76rem; line-height: 1.4; }
.sidebar-status strong { color: #dce6f5; font-size: .78rem; }.sidebar-status strong::first-letter { color: #35d3a1; }
.sidebar-status b { color: #8fc4ff; font-size: .78rem; }
.device-alerts { display: grid; gap: 7px; margin-top: 16px; }.device-alerts-title { display: flex; align-items: center; justify-content: space-between; color: #aab7ca; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }.device-alerts-title b { display: grid; min-width: 18px; height: 18px; place-items: center; border-radius: 999px; color: #f4c0cb; background: #4b202b; font-size: .65rem; }.device-alert { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px; border: 1px solid #303846; border-radius: 11px; color: #dfe7f5; background: #171d27; text-align: left; }.device-alert:hover { border-color: #a7374b; background: #201c26; }.device-alert i { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #4f8cff; box-shadow: 0 0 0 4px rgba(79,140,255,.11); }.device-alert i.income { background: #2dd4a4; box-shadow: 0 0 0 4px rgba(45,212,164,.11); }.device-alert i.expense { background: #ffb347; box-shadow: 0 0 0 4px rgba(255,179,71,.11); }.device-alert span { min-width: 0; display: grid; gap: 2px; }.device-alert strong, .device-alert small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.device-alert strong { font-size: .72rem; }.device-alert small { color: #92a2ba; font-size: .66rem; }
.merchant-main .dashboard-head { align-items: center; min-height: 96px; margin-bottom: 0; }
.merchant-main .dashboard-head h1 { margin-bottom: 8px; font-size: clamp(2rem, 3vw, 2.65rem); }
.merchant-main .grid { gap: 14px; }.merchant-main .grid .card { min-height: 148px; }
.merchant-main .card { border-radius: 17px; }
.merchant-main .rate-row { justify-content: flex-end; min-height: 28px; margin: -2px 0 14px; }.merchant-main .rate-row .muted { display: none; }
.merchant-main .rate-pill { border-color: #8e2540; color: #ffe2e8; background: #3d1722; }
.merchant-main .metric { font-size: clamp(1.75rem, 2.7vw, 2.25rem); }.merchant-main .metric small { color: #8fa5c2; }
.merchant-main .actions { margin-top: 14px; }.merchant-main .actions .button { min-width: 132px; }

/* The toolbar uses a fixed component grid, so theme and status text never shift it. */
.topbar { display: grid; grid-template-columns: 480px minmax(24px, 1fr) auto; gap: 16px; }
.search-box { width: 480px; max-width: 100%; }
.top-actions { display: grid; grid-template-columns: 44px 84px 108px 66px; gap: 9px; }
.top-actions .theme-button, .top-actions .online, .top-actions .profile-button, .top-actions .logout-compact { width: 100%; min-width: 0; }
.top-actions .online { justify-content: center; padding: 0 7px; white-space: nowrap; font-size: .72rem; }
.profile-button { justify-content: flex-start; padding-right: 8px; white-space: nowrap; font-size: .76rem; }
.logout-compact { padding: 9px 7px !important; white-space: nowrap; font-size: .75rem; }
.overview-metrics { margin-bottom: 14px; }.overview-content { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 14px; margin-bottom: 14px; }
.overview-chart, .quick-actions { padding: 20px !important; }.overview-chart .section-title, .quick-actions .section-title { margin-bottom: 16px; }.overview-chart .section-title h2, .quick-actions .section-title h2 { font-size: 1.05rem; }.overview-chart .section-title p, .quick-actions .section-title p { margin: 3px 0 0; }
.mini-chart { position: relative; display: flex; align-items: end; gap: 12px; height: 232px; padding: 16px 8px 2px; border-top: 1px solid #2b313e; background: repeating-linear-gradient(to bottom, transparent 0, transparent 76px, #2b313e 77px, transparent 78px); }
.mini-chart > div { flex: 1; display: flex; align-items: end; gap: 4px; height: 100%; }.mini-chart i { display: block; width: 50%; min-height: 6px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #ff5b75, #c91a3d); }.mini-chart i.payout { background: linear-gradient(180deg, #4f8cff, #325bb8); }
.chart-legend { display: flex; gap: 16px; margin-top: 14px; color: #9aa8bc; font-size: .76rem; }.chart-legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 3px; background: #ff4766; }.chart-legend span + span::before { background: #4f8cff; }
.quick-list { display: grid; gap: 10px; }.quick-list > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 76px; padding: 13px; border: 1px solid #2b313e; border-radius: 13px; background: #12161e; }.quick-list span { display: grid; gap: 4px; }.quick-list strong { color: #f4f7fc; font-size: .83rem; }.quick-list small { color: #98a5b8; font-size: .73rem; }.quick-list .button { min-width: auto; padding: 9px 12px; }
.mini-tag { border: 0; border-radius: 999px; padding: 7px 9px; color: #f6d179; background: rgba(246,183,60,.15); font-size: .69rem; font-weight: 850; white-space: nowrap; }.mini-tag.green { color: #7ff0c8; background: rgba(45,212,164,.14); }.mini-tag:hover { filter: brightness(1.15); }
.overview-traffic { margin-top: 0; }

/* Shared geometry keeps both themes feeling like the same product. */
.sidebar { position: fixed; top: 0; bottom: 0; left: max(20px, calc((100vw - 1400px) / 2)); width: 230px; height: auto; min-height: 0; border-radius: 0; }
.merchant-main { grid-column: 2; }
.topbar, .merchant-workspace { align-items: start; }.sidebar .menu button, .button, .button.ghost, .profile-button, .online, .search-box { border-radius: 12px; }
.deal-list { min-width: 0; max-width: 100%; overflow-x: auto; padding-bottom: 2px; }.deal-card { min-width: 850px; max-width: 100%; grid-template-columns: minmax(230px,1.25fr) minmax(180px,1fr) minmax(115px,.65fr) minmax(160px,.85fr) 108px 54px; }
.device-history { margin-top: 14px; }.history-tabs { display: flex; gap: 7px; margin: 14px 0; }.history-tabs button { border: 1px solid #344154; border-radius: 9px; padding: 7px 10px; color: #9dabbe; background: transparent; font-size: .76rem; font-weight: 750; }.history-tabs button.active { border-color: #bd3c54; color: #fff; background: #48202b; }.history-feed { display: grid; max-height: 420px; gap: 9px; overflow-y: auto; padding: 3px 4px 3px 0; }.message-bubble { width: min(86%, 540px); justify-self: end; padding: 11px 13px; border-radius: 15px 15px 4px 15px; background: #194d43; color: #edfdf8; }.message-bubble small, .notification-history small { display: block; color: #a8c7bd; font-size: .69rem; }.message-bubble p, .notification-history p { display: -webkit-box; margin: 5px 0 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.42; }.notification-history { padding: 11px 13px; border: 1px solid #2d3748; border-radius: 12px; background: #151b25; }.notification-history > div { display: flex; justify-content: space-between; gap: 12px; }.notification-history small { color: #97a6bd; }.notification-history p { color: #d9e2f1; font-size: .82rem; }
.row:has(.diagnostic-message) > div { min-width: 0; max-width: 100%; overflow: hidden; }
.diagnostic-message { display: -webkit-box; max-width: 100%; margin-top: 5px; overflow: hidden; overflow-wrap: anywhere; word-break: break-word; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.42; }
.notification-full-text { margin: 0; overflow-wrap: anywhere; word-break: break-word; line-height: 1.5; white-space: pre-wrap; }

.light-theme .sidebar { border-color: rgba(196,44,62,.23); background: linear-gradient(160deg, rgba(255,255,255,.88), rgba(255,239,241,.72)); box-shadow: 10px 0 34px rgba(163,35,52,.07); backdrop-filter: blur(18px); }.light-theme .sidebar .brand { border-color: transparent; }.light-theme .sidebar .menu button { color: #625d65; }.light-theme .sidebar .menu button i, .light-theme .sidebar-icon { color: #ad4855; }.light-theme .sidebar .menu button.active { border-color: #d54255; color: #a51f31; background: linear-gradient(90deg, #ffe3e7, #fff4f5); }.light-theme .sidebar .menu button.active i, .light-theme .sidebar .menu button.active .sidebar-icon { color: #c92940; }.light-theme .sidebar-status { border-color: #edcbd0; color: #71646b; background: rgba(255,255,255,.75); }.light-theme .topbar { background: transparent !important; }.light-theme .search-box, .light-theme .profile-button { border-color: #e3d9dc; background: rgba(255,255,255,.86); color: #454048; }.light-theme .mini-chart { border-color: #eee6e9; background: repeating-linear-gradient(to bottom, transparent 0, transparent 76px, #eee6e9 77px, transparent 78px); }.light-theme .quick-list > div { border-color: #ebe3e5; background: #fffafb; }.light-theme .quick-list strong { color: #302b32; }.light-theme .message-bubble { background: #dff7ee; color: #173a30; }.light-theme .message-bubble small { color: #5d8678; }.light-theme .notification-history { border-color: #e6dfe2; background: #fff; }.light-theme .notification-history p { color: #403b42; }.light-theme .history-tabs button { border-color: #e5d8dc; color: #7f7378; }.light-theme .history-tabs button.active { border-color: #d54255; color: #a61f31; background: #ffe7eb; }
.light-theme .device-alert { border-color: #efdfe2; color: #463d44; background: rgba(255,255,255,.82); }.light-theme .device-alert:hover { border-color: #d84b5c; background: #fff5f6; }.light-theme .device-alert small, .light-theme .device-alerts-title { color: #8b7880; }.light-theme .device-alerts-title b { color: #b52d40; background: #ffe5e8; }

@media (min-width: 1000px) { .merchant-main > .content { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (max-width: 820px) {
  .shell { width: min(100% - 28px, 1400px); padding-top: 14px; }.topbar { display: flex; margin-left: 0 !important; }.search-box { width: auto; flex: 1; }.top-actions { display: flex; }.top-actions .online, .profile-button span, .logout-compact { display: none; }
  .sidebar { min-height: auto; border-radius: 14px; }.sidebar .brand { display: none; }.sidebar-status { display: none; }
  .overview-content { grid-template-columns: 1fr; }.mini-chart { height: 190px; }
  .sidebar { position: static; width: auto; height: auto; }.merchant-main { grid-column: auto; }.deal-card { min-width: 720px; }.history-feed { max-height: 55vh; }
}

/* Transactions never leave their panel: reduce columns before switching to cards. */
/* Final alignment and notification behavior. */
.merchant-main .dashboard-head { justify-content: space-between; }
.dashboard-rate { display: flex; align-items: center; padding-bottom: 8px; }.dashboard-rate .rate-pill { white-space: nowrap; }
.device-alert { transform-origin: bottom center; transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.device-alert:hover { position: relative; z-index: 2; transform: scale(1.045); box-shadow: 0 10px 24px rgba(0,0,0,.24); }
.test-notification { width: 100%; margin-top: 8px; padding: 8px 10px; border: 1px dashed #44516a; border-radius: 10px; color: #aebbd0; background: transparent; font-size: .72rem; font-weight: 750; }
.test-notification:hover { border-color: #6ad9bb; color: #8ce8d0; background: #132b28; }

/* Non-blocking feedback enters from the bottom edge and stays readable in both themes. */
.toast-region { position: fixed; z-index: 100; right: 24px; bottom: 24px; display: grid; width: min(380px, calc(100vw - 32px)); gap: 10px; pointer-events: none; }
.toast { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 10px; align-items: start; padding: 13px 12px 13px 15px; border: 1px solid #703641; border-radius: 13px; color: #f7eef0; background: #21171b; box-shadow: 0 16px 34px rgba(0,0,0,.28); pointer-events: auto; animation: toast-enter .22s ease-out both; }
.toast p { margin: 0; overflow-wrap: anywhere; white-space: pre-line; font-size: .82rem; line-height: 1.45; }.toast-info { border-color: #8c3d4a; }.toast-error { border-color: #c84a58; background: #351b22; }.toast-close { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 8px; color: inherit; background: transparent; font-size: 1.3rem; line-height: 1; }.toast-close:hover { background: rgba(255,255,255,.1); }.toast.is-leaving { animation: toast-leave .18s ease-in both; }
.light-theme .toast { border-color: #efc2c7; color: #49373b; background: #fffafb; box-shadow: 0 14px 28px rgba(101,31,43,.13); }.light-theme .toast-error { border-color: #df8c96; background: #fff2f3; }.light-theme .toast-close:hover { background: #ffe8eb; }
@keyframes toast-enter { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-leave { to { opacity: 0; transform: translateY(14px) scale(.98); } }
@media (max-width: 620px) { .toast-region { right: 14px; bottom: 14px; width: calc(100vw - 28px); } }

@media (max-width: 1300px) {
  .deal-list { overflow-x: visible; }
  .deal-card { min-width: 0; grid-template-columns: minmax(205px, 1.3fr) minmax(138px, 1fr) minmax(92px, .62fr) minmax(138px, .85fr) 102px 50px; gap: 8px; }
  .deal-result { width: 102px; }.deal-dispute { width: 50px; min-width: 50px !important; }
}
@media (max-width: 900px) {
  .deal-card { grid-template-columns: minmax(190px, 1.25fr) minmax(130px, .9fr) minmax(98px, .65fr) minmax(125px, .8fr) 92px 48px; gap: 7px; padding: 10px; }
  .deal-result { width: 92px; font-size: .68rem; }.deal-dispute { width: 48px; min-width: 48px !important; padding: 7px 2px; font-size: .68rem; }
}
@media (max-width: 720px) {
  .deal-card { grid-template-columns: 1fr 1fr; gap: 12px; }.deal-result, .deal-dispute { justify-self: start; }
}

/* Narrow workspaces use a horizontal navigation rail instead of a fixed side panel. */
@media (max-width: 980px) {
  .shell { width: min(100% - 24px, 760px); padding: 12px 0 36px; }
  .topbar { display: flex; margin: 0 0 12px !important; gap: 10px; }
  .search-box { width: auto; flex: 1 1 220px; min-width: 0; }
  .top-actions { display: flex; flex: 0 0 auto; }
  .top-actions .online, .profile-button span, .logout-compact { display: none; }
  .merchant-workspace { display: block; }
  .sidebar { position: static; inset: auto; box-sizing: border-box; width: 100%; min-height: auto; margin: 0 0 16px; padding: 8px; border-radius: 14px; }
  .sidebar .brand, .sidebar-status, .device-alerts, .test-notification { display: none; }
  .sidebar .menu { display: flex; width: 100%; flex-wrap: nowrap; gap: 4px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .sidebar .menu::-webkit-scrollbar { display: none; }
  .sidebar .menu button { width: auto; min-height: 40px; flex: 0 0 auto; gap: 8px; padding: 8px 10px; font-size: .8rem; white-space: nowrap; }
  .sidebar .sidebar-menu-bottom { margin-top: 7px; padding-top: 7px; }
  .merchant-main { min-width: 0; }
  .merchant-main .dashboard-head { min-height: 0; margin-bottom: 16px; }
  .merchant-main .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-content, .settings-workspace, .merchant-main > .content { grid-template-columns: minmax(0, 1fr); }
  .security-card { grid-column: auto; }
  .filter-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-form .button { width: 100%; }
  .deal-list { overflow-x: visible; }
  .deal-card { min-width: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (max-width: 540px) {
  .shell { width: calc(100% - 20px); }
  .topbar { align-items: center; }
  .top-actions { gap: 6px; }
  .top-actions .theme-button { width: 42px; min-width: 42px; }
  .sidebar { margin-bottom: 14px; }
  .sidebar .menu button { min-height: 38px; padding: 8px 9px; font-size: .76rem; }
  .merchant-main .grid { grid-template-columns: minmax(0, 1fr); }
  .content, .compact-form, .filter-form { grid-template-columns: minmax(0, 1fr); }
  .dashboard-head { align-items: flex-start; gap: 8px; }
  .dashboard-head h1 { font-size: clamp(1.55rem, 8vw, 2rem); }
  .deal-card { grid-template-columns: minmax(0, 1fr); }
  .deal-card strong, .deal-card small { white-space: normal; }
  .dispute-card-head, .dispute-card-foot { align-items: flex-start; flex-direction: column; }
}

/* Settings are a consistent two-column board on desktop, not a mix of wide and narrow cards. */
@media (min-width: 981px) {
  .merchant-main > .settings-workspace { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-workspace > .card { box-sizing: border-box; min-height: 286px; }
  .settings-workspace > .security-card, .settings-workspace > .card:last-child { grid-column: auto; }
  .settings-workspace .compact-form { grid-template-columns: minmax(0, 1fr); }
  .settings-workspace .compact-form .button { width: 100%; }
  .topbar { display: flex; }
  .topbar .search-box { flex: 0 1 480px; }
  .topbar .top-actions { flex: 0 0 auto; margin-left: auto; justify-content: flex-end; }
}

/* Every settings card follows one internal rhythm: header at the top, action at the bottom. */
.settings-workspace { align-items: stretch; }
.setting-card { grid-template-rows: auto minmax(0, 1fr) auto; }
.setting-card > :nth-child(2) { grid-column: 2; grid-row: 1; }
.setting-card-action { grid-column: 1 / -1; grid-row: 3; align-self: end; margin-top: 20px; padding-top: 0; }
.setting-card-action .switch-line { width: 100%; }
.security-card, .settings-workspace > .card:last-child { display: flex; flex-direction: column; }
.security-card .compact-form, .settings-workspace > .card:last-child .form { margin-top: auto; }

@media (max-width: 540px) {
  .setting-card-action { flex-wrap: wrap; }
}

/* Theme switches colour only; the workspace anchor and content grid stay identical. */
.light-theme .shell { width: min(1400px, calc(100% - 40px)); padding-top: 24px; }
.light-theme .dashboard-head { margin-bottom: 0; }
.light-theme .sidebar .brand { font-size: 1rem; letter-spacing: -.025em; }
.light-theme .sidebar .mark { width: 42px; height: 42px; border-radius: 12px; }

@media (max-width: 980px) {
  .light-theme .shell { width: min(100% - 24px, 760px); padding: 12px 0 36px; }
}

@media (max-width: 540px) {
  .light-theme .shell { width: calc(100% - 20px); }
}
