:root {
  --bg: #0f172a;
  --panel: #111827;
  --card: #ffffff;
  --muted: #64748b;
  --text: #0f172a;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand2: #14b8a6;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #059669;
  --soft: #f8fafc;
  --shadow: 0 10px 24px rgba(15,23,42,.05);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--soft); color: var(--text); }
.hidden { display: none !important; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left, rgba(20,184,166,.35), transparent 34%), linear-gradient(135deg, #0f172a, #1e3a8a); }
.login-card { width: min(470px, 100%); background: white; border-radius: 26px; padding: 32px; box-shadow: 0 25px 80px rgba(0,0,0,.3); }
.login-card h1 { margin: 0 0 8px; font-size: clamp(26px, 7vw, 34px); letter-spacing: -.03em; }
.login-card p { margin: 0 0 24px; color: var(--muted); line-height: 1.55; }
label { display:block; margin: 12px 0 6px; font-weight: 800; font-size: 13px; color: #334155; }
label.check { display:flex; align-items:center; gap:10px; font-weight:700; }
label.check input { width:auto; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; font: inherit; background: white; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(37,99,235,.14); border-color: var(--brand); }
textarea { min-height: 86px; resize: vertical; }
button { cursor: pointer; border: 0; border-radius: 12px; padding: 10px 14px; background: var(--brand); color: white; font-weight: 850; transition: transform .12s ease, filter .12s ease; }
button:hover { filter: brightness(.96); transform: translateY(-1px); }
button.secondary { background: #475569; }
button.success { background: var(--ok); }
button.danger { background: var(--danger); }
button.warn { background: var(--warn); }
button.ghost { background: #e2e8f0; color: #0f172a; }
button.full { width: 100%; }
button.icon { padding: 6px 10px; border-radius: 10px; }
button:disabled { opacity: .45; cursor: not-allowed; transform:none; }
a { color: #1d4ed8; font-weight: 800; }
.error { color: var(--danger); margin-top: 12px; font-weight: 800; }
.app { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar { background: var(--bg); color: white; padding: 18px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.logo { width: 48px; height: 48px; border-radius: 15px; background: linear-gradient(135deg, var(--brand), var(--brand2)); display: grid; place-items: center; font-weight: 950; box-shadow: 0 10px 30px rgba(20,184,166,.25); }
.brand h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.brand span { color: #cbd5e1; font-size: 12px; }
nav { display: flex; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; padding-right: 4px; }
nav button { text-align: left; background: transparent; color: #cbd5e1; padding: 12px; border-radius: 12px; }
nav button.active, nav button:hover { background: rgba(255,255,255,.11); color: white; transform: none; }
.main { min-width: 0; }
.topbar { background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding: 20px 28px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; gap: 16px; }
.topbar h1 { margin: 0; font-size: clamp(22px, 4vw, 28px); letter-spacing: -.03em; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.status-pill { white-space: nowrap; padding: 8px 12px; border-radius: 999px; background: #dcfce7; color: #166534; font-weight: 850; font-size: 13px; }
#content { padding: 28px; }
.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.full-span { grid-column: 1 / -1; }
.card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin: 0 0 14px; letter-spacing: -.02em; }
.metric { font-size: clamp(22px, 4vw, 30px); font-weight: 950; letter-spacing: -.04em; }
.sub { color: var(--muted); font-size: 13px; }
.mt { margin-top: 16px; }
.mt-sm { margin-top: 12px; }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar.compact { margin: 0 0 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.table-wrap { width:100%; overflow:auto; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; color: var(--muted); background: #f8fafc; position: sticky; top: 0; z-index: 1; }
tr:hover td { background: #f8fafc; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 850; background: #e2e8f0; color: #334155; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.danger { background: #fee2e2; color: #991b1b; }
.badge.blue { background: #dbeafe; color: #1d4ed8; }
.detail-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(320px,.8fr); gap: 16px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px; font-size: 14px; }
.kv b { color: #475569; }
.split-row { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; background: #fff; }
.progress { height: 9px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress span { display:block; height:100%; background: linear-gradient(90deg, var(--brand), var(--brand2)); width: 0; }
.chat { max-height: 460px; min-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px; background: linear-gradient(180deg,#f8fafc,#eef2ff); border: 1px solid var(--border); border-radius: 18px; scroll-behavior: smooth; }
.chat-row { display:flex; width:100%; }
.chat-row.me { justify-content:flex-end; }
.chat-row.them { justify-content:flex-start; }
.chat-bubble { max-width: 78%; padding: 9px 12px 7px; border-radius: 16px; background:#fff; box-shadow: 0 6px 18px rgba(15,23,42,.06); border:1px solid rgba(148,163,184,.22); }
.chat-row.me .chat-bubble { background:#dbeafe; border-color:#bfdbfe; border-bottom-right-radius:5px; }
.chat-row.them .chat-bubble { background:#ffffff; border-bottom-left-radius:5px; }
.chat-meta { display:flex; justify-content:space-between; gap:14px; font-size:11px; color:#64748b; margin-bottom:4px; font-weight:700; }
.chat-body { white-space:pre-wrap; overflow-wrap:anywhere; word-break:break-word; color:#0f172a; line-height:1.45; }
.chat-time { color:#64748b; font-size:10px; text-align:right; margin-top:5px; }
.sync-status { display:inline-flex; align-items:center; gap:6px; padding:5px 9px; border-radius:999px; background:#eff6ff; color:#1d4ed8; font-size:12px; font-weight:800; }
.sync-status.busy { background:#fff7ed; color:#c2410c; }
.sync-status.ok { background:#dcfce7; color:#166534; }
.sync-status.warn { background:#fef3c7; color:#92400e; }
.quiet-sync-status { display:inline-block; margin-left:8px; color:#64748b; font-size:12px; }
.pill-link { display:inline-block; margin-top:6px; padding: 4px 8px; border-radius: 999px; background:#ecfeff; color:#155e75; text-decoration:none; font-size:12px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.62); display: grid; place-items: center; z-index: 100; padding: 24px; }
.modal { width: min(760px, 100%); max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; background: white; border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 18px; overflow-y: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full-row { grid-column: 1 / -1; }
.notice { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: 12px; border-radius: 12px; margin: 12px 0; }
.okbox { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; padding: 12px; border-radius: 12px; margin: 12px 0; }
pre { white-space: pre-wrap; word-break: break-word; background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 14px; max-height: 240px; overflow:auto; }
.skeleton { min-height: 90px; color: var(--muted); }
@media (max-width: 1180px) {
  .grid.cards, .grid.three { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-radius: 0 0 24px 24px; }
  nav { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); max-height: none; }
  .grid.cards, .grid.two, .grid.three, .form-grid { grid-template-columns: 1fr; }
  .topbar { position: static; align-items:flex-start; flex-direction: column; padding: 18px; }
  #content { padding: 18px; }
  .kv { grid-template-columns: 1fr; }
  table { min-width: 700px; }
  .modal-backdrop { padding: 12px; }
}
@media (max-width: 480px) {
  .login-card { padding: 24px; border-radius: 20px; }
  nav { grid-template-columns: 1fr; }
  button { width: auto; }
  .actions button { flex: 1 1 auto; }
  .brand { align-items:flex-start; }
}
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.perm-grid label { margin: 0; }
@media (max-width: 820px) { .perm-grid { grid-template-columns: 1fr; } }

.info-card p { margin: 0; color: #475569; line-height: 1.6; }
.route-flow { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.route-flow span { background:#f1f5f9; border:1px solid var(--line); border-radius:999px; padding:8px 12px; font-weight:800; color:#334155; }
.report-section { background:white; border:1px solid var(--line); border-radius:18px; padding:18px; box-shadow:var(--shadow); }
.report-section h3 { margin:0 0 14px; }
.report-cards { display:grid; grid-template-columns:repeat(auto-fit, minmax(230px, 1fr)); gap:12px; }
.report-cards.wide { grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); }
.report-card { border:1px solid var(--line); border-radius:16px; padding:14px; background:#fff; }
.report-card-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.report-line { display:flex; justify-content:space-between; gap:12px; padding:7px 0; border-top:1px dashed #e2e8f0; }
.report-line span { color:var(--muted); font-size:13px; }
.report-line b { text-align:right; }
@media (max-width: 820px) {
  .table-wrap { overflow: visible; }
  table { min-width: 0; display:block; }
  table thead { display:none; }
  table tbody, table tr, table td { display:block; width:100%; }
  table tr { border:1px solid var(--line); border-radius:14px; margin-bottom:12px; padding:10px; background:white; box-shadow:var(--shadow); }
  table td { border-bottom:1px dashed #e2e8f0; padding:9px 4px; }
  table td:last-child { border-bottom:0; }
  table td::before { content: attr(data-label); display:block; font-size:11px; text-transform:uppercase; color:var(--muted); font-weight:900; margin-bottom:4px; }
  tr:hover td { background: transparent; }
  .route-flow { flex-direction:column; align-items:stretch; }
  .route-flow b { text-align:center; }
}
@media print {
  .sidebar, .topbar .status-pill, .toolbar, button { display:none !important; }
  .app { display:block; }
  #content { padding:0; }
  .card, .report-section, .report-card { box-shadow:none; break-inside:avoid; }
}

/* v5 smoother app UX + cleaner dashboard */
#content { transition: opacity .18s ease, transform .18s ease; }
#content.soft-updating { opacity: .86; transform: translateY(2px); }
.compact-stat { background:#eef2ff; color:#3730a3; border:1px solid #c7d2fe; padding:8px 12px; border-radius:999px; font-size:13px; font-weight:900; }
.dash-hero { overflow:hidden; position:relative; display:flex; justify-content:space-between; align-items:flex-end; gap:18px; padding:24px; border-radius:24px; color:white; background: radial-gradient(circle at 15% 20%, rgba(20,184,166,.55), transparent 30%), linear-gradient(135deg, #0f172a, #1d4ed8 58%, #14b8a6); box-shadow: 0 22px 60px rgba(15,23,42,.18); }
.dash-hero::after { content:""; position:absolute; right:-80px; top:-80px; width:240px; height:240px; border-radius:999px; background:rgba(255,255,255,.13); }
.dash-hero h2 { position:relative; margin:6px 0; font-size:clamp(28px, 5vw, 44px); letter-spacing:-.05em; }
.dash-hero p { position:relative; margin:0; color:#dbeafe; max-width:560px; }
.dash-eyebrow { position:relative; display:inline-flex; padding:6px 10px; border-radius:999px; background:rgba(255,255,255,.16); color:#ecfeff; font-size:12px; font-weight:950; text-transform:uppercase; letter-spacing:.08em; }
.dash-hero-amount { position:relative; text-align:right; min-width:220px; }
.dash-hero-amount span { display:block; color:#bfdbfe; font-size:13px; font-weight:850; }
.dash-hero-amount b { display:block; font-size:clamp(24px, 4vw, 36px); letter-spacing:-.04em; }
.metric-card { position:relative; overflow:hidden; min-height:132px; display:flex; flex-direction:column; justify-content:flex-end; gap:7px; border:0; background:linear-gradient(180deg, #ffffff, #f8fafc); }
.metric-card::before { content:""; position:absolute; inset:0 0 auto 0; height:5px; background:linear-gradient(90deg, var(--brand), var(--brand2)); }
.metric-card span { color:var(--muted); font-size:13px; font-weight:850; }
.metric-card b { font-size:clamp(22px, 4vw, 31px); letter-spacing:-.04em; }
.metric-icon { position:absolute; right:14px; top:14px; width:38px; height:38px; display:grid; place-items:center; border-radius:14px; background:#eff6ff; color:#1d4ed8; font-weight:950; }
.dash-main { display:grid; grid-template-columns:minmax(0, 1.55fr) minmax(290px, .45fr); gap:16px; }
.dash-card { border:0; box-shadow:0 14px 38px rgba(15,23,42,.07); }
.section-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:14px; }
.section-head h3 { margin:0; }
.section-head span { color:var(--muted); font-size:12px; font-weight:900; }
.method-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(210px, 1fr)); gap:12px; }
.method-card { border:1px solid var(--line); border-radius:18px; padding:14px; background:#fbfdff; }
.method-card > div:first-child { display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
.method-card > div:first-child b { font-size:17px; }
.method-card > div:first-child span { color:var(--muted); font-size:12px; font-weight:850; }
.method-money { font-size:24px; font-weight:950; letter-spacing:-.04em; margin:10px 0; }
.mini-row, .today-stack > div, .report-line { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.mini-row span, .today-stack span { color:var(--muted); font-size:13px; font-weight:850; }
.today-stack { display:grid; gap:10px; }
.today-stack > div { background:#f8fafc; border:1px solid var(--line); padding:13px; border-radius:16px; }
.today-stack b { font-size:18px; }
.agent-list, .alert-list { display:grid; gap:10px; }
.agent-row { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:12px; border:1px solid var(--line); border-radius:16px; background:#fff; }
.agent-row span { display:block; color:var(--muted); font-size:12px; margin-top:3px; }
.agent-row > div:last-child { text-align:right; }
.alert-item { padding:12px; border-radius:16px; border:1px solid #fed7aa; background:#fff7ed; display:grid; gap:4px; }
.alert-item span { color:#7c2d12; font-size:13px; }
.alert-item small { color:#9a3412; }
.empty-state { padding:18px; text-align:center; color:var(--muted); background:#f8fafc; border-radius:16px; border:1px dashed var(--line); }
@media (max-width: 1000px) { .dash-main { grid-template-columns:1fr; } }
@media (max-width: 720px) { .dash-hero { align-items:flex-start; flex-direction:column; } .dash-hero-amount { text-align:left; min-width:0; } .agent-row { align-items:flex-start; flex-direction:column; } .agent-row > div:last-child { text-align:left; } }

/* v6 partial agent completion + live remaining preview */
.live-remaining { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 14px; border:1px solid #bae6fd; background:#f0f9ff; color:#075985; border-radius:14px; margin:12px 0; font-weight:900; }
.live-remaining span { color:#0369a1; font-size:12px; font-weight:800; }
@media (max-width: 620px) { .live-remaining { align-items:flex-start; flex-direction:column; } }

/* v7: global action feedback */
#toastWrap { position: fixed; right: 18px; bottom: 18px; z-index: 9999; display: grid; gap: 10px; width: min(390px, calc(100vw - 36px)); }
.toast { border-radius: 16px; padding: 12px 14px; box-shadow: 0 18px 44px rgba(15,23,42,.22); display: grid; gap: 4px; animation: toastIn .18s ease-out; border: 1px solid rgba(255,255,255,.45); }
.toast b { font-size: 13px; }
.toast span { font-size: 13px; line-height: 1.45; }
.toast.danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.toast.warn { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.toast.ok { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.form-message { margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-size: 13px; font-weight: 800; line-height: 1.45; }
.form-message:empty { display: none; }
.form-message.danger { background:#fef2f2; color:#991b1b; border:1px solid #fecaca; }
.form-message.warn { background:#fff7ed; color:#9a3412; border:1px solid #fed7aa; }
.form-message.ok { background:#f0fdf4; color:#166534; border:1px solid #bbf7d0; }
.live-remaining span { display:inline-block; margin-left:8px; color: var(--muted); font-weight: 700; }
@keyframes toastIn { from { opacity:0; transform: translateY(10px) scale(.98); } to { opacity:1; transform:none; } }

/* v8: customizable reports, user admin polish, login OTP */
.otp-panel { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: #f8fafc; }
.notice.small { font-size: 13px; margin: 0 0 10px; }
.admin-hero { position: relative; overflow: hidden; display:flex; justify-content:space-between; align-items:stretch; gap:18px; border-radius:24px; padding:24px; color:white; background: radial-gradient(circle at 20% 10%, rgba(20,184,166,.55), transparent 28%), linear-gradient(135deg, #111827, #1e40af 58%, #0891b2); box-shadow: 0 22px 58px rgba(15,23,42,.16); }
.admin-hero h2 { margin: 8px 0; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.05em; }
.admin-hero p { margin:0; color:#dbeafe; max-width:640px; line-height:1.55; }
.admin-quick-stats { display:grid; grid-template-columns: repeat(3, minmax(105px, 1fr)); gap:10px; min-width:min(420px, 100%); }
.admin-quick-stats > div { background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.18); border-radius:18px; padding:14px; backdrop-filter: blur(8px); }
.admin-quick-stats span { display:block; color:#bfdbfe; font-size:12px; font-weight:900; }
.admin-quick-stats b { display:block; margin-top:6px; font-size:clamp(20px, 3vw, 28px); letter-spacing:-.04em; }
.user-card { display:grid; gap:14px; border:1px solid var(--line); border-radius:18px; padding:16px; background:linear-gradient(180deg, #fff, #f8fafc); box-shadow:var(--shadow); }
.user-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.user-card-head b { font-size:18px; }
.user-card-head span { display:block; color:var(--muted); font-size:12px; margin-top:4px; }
.user-stats { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:10px; }
.user-stats > div { border:1px solid var(--line); border-radius:14px; padding:10px; background:white; }
.user-stats span { display:block; color:var(--muted); font-size:12px; font-weight:850; }
.user-stats b { display:block; margin-top:4px; font-size:16px; }
.report-filter { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.report-filter h3 { margin:0 0 4px; }
.report-filter p { margin:0; color:var(--muted); }
.report-filter-form { display:flex; gap:8px; flex-wrap:wrap; align-items:center; justify-content:flex-end; }
.report-filter-form select, .report-filter-form input { width:auto; min-width:145px; }
.admin-card { border:0; box-shadow: 0 14px 38px rgba(15,23,42,.07); }
@media (max-width: 980px) {
  .admin-hero, .report-filter { flex-direction:column; align-items:stretch; }
  .admin-quick-stats { grid-template-columns:1fr; min-width:0; }
  .report-filter-form { justify-content:stretch; }
  .report-filter-form select, .report-filter-form input, .report-filter-form button { width:100%; }
}

/* v9: P2P order detail, role builder, statement wording */
.order-info-grid { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:16px; }
.order-mini { border:0; box-shadow:0 14px 38px rgba(15,23,42,.07); }
.big-flow { margin:10px 0 14px; padding:14px; border-radius:16px; background:linear-gradient(135deg,#eff6ff,#f0fdfa); border:1px solid #bfdbfe; color:#0f172a; font-weight:950; font-size:18px; letter-spacing:-.02em; }
.history-grid { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap:10px; }
.history-grid > div { padding:10px; border:1px solid var(--line); border-radius:14px; background:#f8fafc; }
.history-grid span { display:block; color:var(--muted); font-size:11px; font-weight:900; text-transform:uppercase; }
.history-grid b { display:block; margin-top:4px; font-size:18px; letter-spacing:-.03em; }
.perm-preview { display:flex; gap:6px; flex-wrap:wrap; }
.perm-preview span { padding:6px 8px; border-radius:999px; background:#eef2ff; color:#3730a3; font-size:11px; font-weight:850; }
.role-card .actions { margin-top:auto; }
@media (max-width: 1100px) { .order-info-grid { grid-template-columns:1fr; } }
@media (max-width: 620px) { .history-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); } }

/* v10: cleaner order detail design + visible P2P feedback comments */
.order-page { display:grid; gap:16px; }
.order-hero-panel { position:relative; overflow:hidden; display:flex; justify-content:space-between; gap:20px; align-items:stretch; padding:24px; border-radius:28px; color:white; background: radial-gradient(circle at 14% 18%, rgba(20,184,166,.50), transparent 28%), linear-gradient(135deg, #0f172a, #1d4ed8 58%, #0891b2); box-shadow:0 24px 70px rgba(15,23,42,.20); }
.order-hero-panel::after { content:""; position:absolute; right:-70px; top:-90px; width:260px; height:260px; border-radius:999px; background:rgba(255,255,255,.12); }
.order-hero-main, .order-hero-amount-card { position:relative; z-index:1; }
.order-eyebrow { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.order-hero-main h2 { margin:12px 0 8px; font-size:clamp(28px, 4.6vw, 46px); letter-spacing:-.055em; }
.order-hero-main p { margin:0; color:#dbeafe; font-weight:800; font-size:16px; }
.order-hero-pills { display:flex; gap:10px; flex-wrap:wrap; margin-top:16px; }
.order-hero-pills span { display:inline-flex; gap:6px; align-items:center; padding:8px 12px; border-radius:999px; background:rgba(255,255,255,.13); border:1px solid rgba(255,255,255,.18); color:#dbeafe; font-size:13px; font-weight:850; }
.order-hero-pills b { color:white; }
.order-hero-amount-card { min-width:min(360px, 100%); align-self:stretch; display:grid; align-content:center; justify-items:end; gap:6px; padding:20px; border-radius:24px; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.20); backdrop-filter: blur(8px); }
.order-hero-amount-card span, .order-hero-amount-card small { color:#bfdbfe; font-weight:900; }
.order-hero-amount-card b { font-size:clamp(28px, 4vw, 42px); letter-spacing:-.055em; }
.order-actions-card { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; padding:12px; border:1px solid var(--line); border-radius:20px; background:rgba(255,255,255,.78); box-shadow:0 12px 34px rgba(15,23,42,.06); }
.order-action-status { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.order-top-grid { display:grid; grid-template-columns: minmax(230px,.8fr) minmax(280px,1fr) minmax(420px,1.45fr); gap:16px; }
.order-workspace { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(360px,.65fr); gap:16px; align-items:start; }
.order-main-stack, .order-side-stack { display:grid; gap:16px; }
.order-card { border:0; box-shadow:0 16px 44px rgba(15,23,42,.075); }
.summary-card { background:linear-gradient(180deg, #fff, #f8fbff); }
.order-summary-grid { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:12px; }
.summary-tile { padding:16px; border:1px solid var(--line); border-radius:18px; background:white; }
.summary-tile span { display:block; color:var(--muted); font-size:12px; font-weight:900; }
.summary-tile b { display:block; margin:5px 0; font-size:clamp(22px, 4vw, 31px); letter-spacing:-.045em; }
.summary-tile small { color:var(--muted); font-weight:750; }
.final-check-strip { margin-top:14px; padding:12px 14px; border-radius:16px; color:#075985; background:#f0f9ff; border:1px solid #bae6fd; font-weight:850; }
.split-list { display:grid; gap:10px; }
.split-row { margin-bottom:0; border-radius:18px; background:linear-gradient(180deg,#fff,#f8fafc); }
.statement-feed { display:grid; gap:10px; }
.statement-item { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:12px; border-radius:16px; border:1px solid var(--line); background:#fff; }
.statement-item > div:last-child { text-align:right; }
.statement-item span { display:block; margin-top:3px; color:var(--muted); font-size:12px; font-weight:800; }
.statement-item.ok { border-color:#bbf7d0; background:#f0fdf4; }
.statement-item.danger { border-color:#fecaca; background:#fef2f2; }
.statement-item.warn { border-color:#fed7aa; background:#fff7ed; }
.empty-state.small { padding:14px; }
.counterparty-card { grid-row: span 2; }
.counterparty-score-row { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:10px; }
.score-card { padding:12px; border-radius:16px; border:1px solid var(--line); background:#f8fafc; }
.score-card span { display:block; color:var(--muted); text-transform:uppercase; font-size:11px; font-weight:950; }
.score-card b { display:block; margin-top:5px; font-size:22px; letter-spacing:-.04em; }
.score-card.positive { border-color:#bbf7d0; background:#f0fdf4; color:#166534; }
.score-card.negative { border-color:#fecaca; background:#fef2f2; color:#991b1b; }
.counterparty-mini-grid { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:10px; margin-top:12px; }
.counterparty-mini-grid > div { border:1px dashed var(--line); border-radius:14px; padding:10px; background:#fff; }
.counterparty-mini-grid span { display:block; color:var(--muted); font-size:11px; font-weight:950; text-transform:uppercase; }
.counterparty-mini-grid b { display:block; margin-top:4px; }
.feedback-wrap { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:14px; }
.feedback-panel { border-radius:18px; padding:12px; border:1px solid var(--line); background:#fff; }
.feedback-panel.positive { border-color:#bbf7d0; background:#f8fffb; }
.feedback-panel.negative { border-color:#fecaca; background:#fffafa; }
.feedback-panel h4 { margin:0 0 10px; font-size:13px; letter-spacing:-.01em; }
.feedback-comment { padding:10px; border-radius:14px; background:rgba(255,255,255,.82); border:1px solid rgba(148,163,184,.22); margin-bottom:8px; }
.feedback-comment:last-child { margin-bottom:0; }
.feedback-comment b { display:block; font-size:13px; }
.feedback-comment p { margin:4px 0; color:#334155; line-height:1.45; font-size:13px; }
.feedback-comment small { color:var(--muted); }
.order-mini .kv { grid-template-columns: 130px 1fr; }
.order-mini .section-head { margin-bottom:12px; }
@media (max-width: 1280px) {
  .order-top-grid { grid-template-columns:1fr; }
  .counterparty-card { grid-row:auto; }
}
@media (max-width: 1050px) { .order-workspace { grid-template-columns:1fr; } }
@media (max-width: 820px) {
  .order-hero-panel { flex-direction:column; padding:20px; }
  .order-hero-amount-card { justify-items:start; }
  .order-summary-grid, .counterparty-score-row, .counterparty-mini-grid, .feedback-wrap { grid-template-columns:1fr 1fr; }
}
@media (max-width: 560px) {
  .order-actions-card .actions button { width:100%; }
  .order-summary-grid, .counterparty-score-row, .counterparty-mini-grid, .feedback-wrap { grid-template-columns:1fr; }
  .statement-item { align-items:flex-start; flex-direction:column; }
  .statement-item > div:last-child { text-align:left; }
}

/* v12: cleaner order page - hero owns order/rate/amount info, P2P Info opens from chat header */
.order-hero-panel { align-items: center; }
.order-hero-main { flex: 1 1 auto; }
.order-hero-pills { max-width: 980px; }
.order-hero-mini-ledger { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.order-hero-mini-ledger > div { text-align: right; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); }
.order-hero-mini-ledger span { display: block; color: #bfdbfe; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.order-hero-mini-ledger b { display: block; margin-top: 3px; font-size: 17px; letter-spacing: -.03em; }
.order-workspace.mt { margin-top: 0; }
.chat-head { align-items: center; }
.mini-action { padding: 8px 12px; border-radius: 12px; font-size: 12px; white-space: nowrap; }
.p2p-info-modal .counterparty-card { box-shadow: none; border: 0; padding: 0; }
.p2p-info-modal .counterparty-card .section-head { display: none; }
.p2p-info-modal .feedback-wrap { grid-template-columns: 1fr 1fr; }
.order-page .counterparty-card { min-height: 0; }
@media (max-width: 820px) {
  .order-hero-mini-ledger > div { text-align: left; }
  .chat-head { align-items: flex-start; }
}
@media (max-width: 560px) {
  .order-hero-mini-ledger, .p2p-info-modal .feedback-wrap { grid-template-columns: 1fr; }
  .chat-head { flex-direction: column; }
  .chat-head .mini-action { width: 100%; }
}

.top-actions { display:flex; align-items:center; gap:10px; }
.lang-toggle { border:1px solid rgba(37,99,235,.22); background:#fff; color:#1d4ed8; font-weight:800; border-radius:999px; padding:9px 14px; box-shadow:0 8px 20px rgba(15,23,42,.08); cursor:pointer; }
.lang-toggle:hover { transform:translateY(-1px); box-shadow:0 12px 24px rgba(15,23,42,.12); }
.login-lang { position:absolute; top:18px; right:18px; }
.login-card { position:relative; }
.lang-bn { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans Bengali", "Segoe UI", sans-serif; }
@media (max-width: 720px) { .top-actions { width:100%; justify-content:space-between; } .login-lang { position:static; float:right; margin-bottom:10px; } }

.approval-list { display: grid; gap: 10px; }
.approval-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--soft); }
.approval-row .actions, .approval-row div:last-child { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 720px) { .approval-row { display: grid; } .approval-row div:last-child { justify-content: flex-start; } }

/* v1.0.24 health check */
.mini-pre { max-width: 520px; max-height: 170px; overflow:auto; white-space: pre-wrap; word-break: break-word; margin:0; padding:10px; border-radius:12px; background:#0f172a; color:#e2e8f0; font-size:11px; line-height:1.45; }

.chat-image{max-width:260px;max-height:220px;border-radius:12px;margin-top:8px;border:1px solid var(--border);display:block}.chat-image-link{display:inline-block;font-size:12px;font-weight:800;margin-bottom:4px}.chat-head-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.inline-check{display:flex;gap:8px;align-items:center;margin:8px 0;color:var(--muted);font-size:13px}
.inline-check input{width:auto}

/* v1.0.30 UI polish */
.sidebar { background: radial-gradient(circle at 20% 0%, rgba(20,184,166,.22), transparent 28%), linear-gradient(180deg, #0b1224 0%, #111827 58%, #0f172a 100%); border-right: 1px solid rgba(255,255,255,.08); }
.brand { padding: 8px; border-radius: 18px; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.logo { border-radius: 18px; }
nav { gap: 6px; }
nav button { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 850; letter-spacing: -.01em; border: 1px solid transparent; }
nav button:before { content: ''; width: 8px; height: 8px; border-radius: 999px; background: rgba(203,213,225,.45); box-shadow: 0 0 0 4px rgba(255,255,255,.03); }
nav button.active { background: linear-gradient(135deg, rgba(37,99,235,.28), rgba(20,184,166,.18)); border-color: rgba(147,197,253,.28); box-shadow: 0 10px 28px rgba(0,0,0,.16); }
nav button.active:before { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.14); }
.metric-card.clickable, .method-card.clickable, .agent-row.clickable, .alert-item.clickable { cursor: pointer; }
.metric-card.clickable:hover, .method-card.clickable:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(15,23,42,.10); border-color: #bfdbfe; }
.order-section-note { color: var(--muted); font-size: 13px; margin-top: 8px; }

/* v1.0.32 smooth live chat */
.sync-status.live { background:#dcfce7; color:#166534; }
.sync-status.live::before { content:''; width:7px; height:7px; border-radius:999px; background:#22c55e; display:inline-block; box-shadow:0 0 0 4px rgba(34,197,94,.12); }
.chat-compose { display:flex; flex-direction:column; gap:8px; }
.chat-compose textarea { min-height:72px; resize:vertical; }
.chat-compose-actions { display:flex; align-items:center; gap:8px; justify-content:flex-end; flex-wrap:wrap; }
.upload-pill { display:inline-flex; align-items:center; gap:6px; padding:9px 12px; border:1px solid var(--border); border-radius:999px; background:#f8fafc; cursor:pointer; font-weight:800; color:#334155; }
.upload-pill:hover { background:#eef2ff; border-color:#c7d2fe; }
.chat-bubble { font-size:14px; }
.chat-row.me .chat-meta { color:#1d4ed8; }
.chat-image { max-width:min(280px, 72vw); max-height:240px; object-fit:contain; background:#fff; }

/* v1.0.33 Binance-style order tabs */
.order-tabs { display:flex; flex-wrap:wrap; gap:8px; margin: 10px 0 14px; }
.order-tab { border:1px solid var(--line); background:#f8fafc; color:#334155; border-radius:999px; padding:8px 12px; font-weight:900; cursor:pointer; }
.order-tab b { margin-left:4px; color:#0f172a; }
.order-tab.active { background:#0f172a; color:white; border-color:#0f172a; }
.order-tab.active b { color:white; }
.order-tab-panel { display:none; }
.order-tab-panel.active { display:block; }

.order-group-switch{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:12px}
.order-group-btn{border:1px solid var(--border);background:#f8fafc;color:#0f172a;border-radius:999px;padding:10px 14px;font-weight:800;cursor:pointer}
.order-group-btn.active{background:#0f172a;color:#fff;box-shadow:0 8px 18px rgba(15,23,42,.16)}
.order-group-btn b{margin-left:6px;opacity:.9}
.soft-card{background:linear-gradient(180deg,#fff,#f8fbff)}

/* v1.0.40 order status/payment highlights */
.payment-method-highlight, .method-badge {
  display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px;
  background:#ecfeff; color:#0e7490; border:1px solid #a5f3fc; font-weight:900; box-shadow:0 4px 12px rgba(8,145,178,.10);
}
.order-status-banner { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-top:12px; padding:14px 16px; border-radius:18px; border:1px solid var(--line); background:#f8fafc; }
.order-status-banner div span { display:block; font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); font-weight:900; }
.order-status-banner div b { font-size:20px; letter-spacing:-.03em; }
.order-status-banner p { margin:0; color:#475569; font-weight:800; }
.order-status-banner.blue { background:#eff6ff; border-color:#bfdbfe; }
.order-status-banner.warn { background:#fffbeb; border-color:#fde68a; }
.order-status-banner.ok { background:#ecfdf5; border-color:#bbf7d0; }
.order-status-banner.danger { background:#fef2f2; border-color:#fecaca; animation:pulseDanger 1.5s ease-in-out 2; }
.order-hero-mini-ledger.single { grid-template-columns:1fr; }
.order-hero-mini-ledger.single > div { text-align:right; }
@keyframes pulseDanger { 0%,100%{box-shadow:none} 50%{box-shadow:0 0 0 4px rgba(239,68,68,.18)} }

/* v1.0.41 BUY customer payment details */
.customer-pay-card { border:1px solid #bfdbfe; background:linear-gradient(180deg,#ffffff,#f8fbff); }
.customer-pay-card.muted-card { border-color:var(--line); background:#f8fafc; }
.customer-pay-note { margin:-2px 0 12px; color:#475569; font-weight:800; line-height:1.45; }
.customer-pay-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
.customer-pay-grid > div { padding:12px; border:1px solid var(--line); border-radius:16px; background:white; }
.customer-pay-grid span { display:block; color:var(--muted); font-size:11px; font-weight:950; text-transform:uppercase; letter-spacing:.04em; }
.customer-pay-grid b { display:block; margin-top:5px; font-size:15px; word-break:break-word; }
.pay-qr { margin-top:12px; padding:12px; border-radius:16px; border:1px dashed #93c5fd; background:#eff6ff; }
.pay-qr a { display:inline-flex; align-items:center; gap:12px; color:#1d4ed8; font-weight:950; text-decoration:none; }
.pay-qr img { width:92px; height:92px; object-fit:contain; border-radius:12px; background:white; border:1px solid #bfdbfe; }
@media (max-width: 560px) { .customer-pay-grid { grid-template-columns:1fr; } }
