:root {
  --brand-navy: #0b1f3a;
  --brand-navy-deep: #071528;
  --brand-blue: #164b8f;
  --brand-blue-soft: #eaf1f9;
  --brand-red: #d81f36;
  --business-bg: #f3f5f8;
  --business-line: #dfe4ea;
  --business-text: #172437;
  --business-muted: #687587;
}

body { color: var(--business-text); background: var(--business-bg); }
.ambient { display: none; }

/* Corporate sign-in */
.login-shell { min-height: 100vh; padding: 40px; background: #edf1f5; }
.login-shell::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--brand-red) 0 88px, var(--brand-navy) 88px 100%); }
.login-shell::after { display: none; }
.login-card { width: min(1160px, 100%); min-height: 680px; display: grid; grid-template-columns: 1.06fr .94fr; padding: 0; overflow: hidden; border: 1px solid #d7dde5; border-radius: 10px; background: #fff; box-shadow: 0 24px 60px rgba(22, 35, 52, .12); }
.login-visual { position: relative; min-height: 680px; display: flex; flex-direction: column; padding: 54px 58px; overflow: hidden; color: #fff; background: var(--brand-navy); }
.login-visual::before { content: ""; position: absolute; inset: 0; opacity: .13; background-image: linear-gradient(rgba(255,255,255,.2) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(145deg, transparent 10%, #000 65%, transparent 100%); }
.login-visual::after { content: ""; position: absolute; width: 360px; height: 360px; right: -190px; bottom: -190px; border: 62px solid rgba(255,255,255,.055); border-radius: 50%; }
.corporate-mark { position: relative; z-index: 2; display: flex; align-items: baseline; gap: 13px; }
.corporate-mark strong { color: #fff; font-size: 24px; letter-spacing: -.04em; }
.corporate-mark strong::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; background: var(--brand-red); }
.corporate-mark span { color: rgba(255,255,255,.52); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.visual-grid, .visual-ring, .visual-orb { display: none; }
.visual-copy { position: relative; z-index: 2; max-width: 500px; margin-top: auto; margin-bottom: auto; }
.visual-copy > span { color: #8fb2dc; font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.visual-copy strong { display: block; margin-top: 22px; color: #fff; font-size: clamp(38px, 4vw, 54px); line-height: 1.24; letter-spacing: -.045em; }
.visual-copy p { max-width: 430px; margin: 24px 0 0; color: rgba(255,255,255,.67); font-size: 14px; line-height: 1.8; }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 64px 72px; background: #fff; }
.brand-block { padding-bottom: 25px; border-bottom: 1px solid var(--business-line); }
.login-panel .brand-logo { width: 116px; }
.brand-tag { border-radius: 4px; color: #506075; background: #eef1f5; }
.login-panel .login-copy { margin: 44px 0 32px; }
.login-panel .login-copy h1 { color: var(--brand-navy); font-size: 34px; font-weight: 800; letter-spacing: -.035em; }
.login-panel .login-copy > p:last-child { margin-top: 12px; color: var(--business-muted); font-size: 13px; }
.login-panel .eyebrow { color: var(--brand-blue); }
.login-form { gap: 11px; }
.login-form label { color: #3f4c5e; font-size: 12px; }
.login-input > span:first-child { display: none; }
.login-input input { min-height: 50px; padding-left: 15px; border-color: #ccd4dd; border-radius: 6px; background: #fff; }
.login-input input:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(22,75,143,.1); }
.login-input.password-wrap input { padding-right: 62px; }
.login-panel .primary-button { min-height: 50px; border-radius: 6px; background: var(--brand-blue); box-shadow: none; }
.login-panel .primary-button:hover { background: #103e79; box-shadow: none; }
.security-note { margin-top: 26px; color: #778293; }
.shield { border-radius: 4px; }

/* Merchant back office */
.app-shell { width: 100%; min-height: 100vh; margin: 0; display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: 70px 1fr auto; overflow: visible; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
.sidebar { grid-row: 1 / 4; grid-column: 1; display: flex; flex-direction: column; align-items: stretch; padding: 0 16px 22px; border: 0; background: var(--brand-navy-deep); }
.sidebar-logo { width: auto; height: 70px; display: flex; align-items: center; justify-content: flex-start; overflow: visible; padding: 0 12px; border-bottom: 1px solid rgba(255,255,255,.1); border-radius: 0; background: transparent; box-shadow: none; }
.sidebar-logo::after { content: "MERCHANT"; margin-left: 10px; color: rgba(255,255,255,.45); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.sidebar-logo img { width: 42px; height: 42px; border-radius: 5px; object-fit: cover; }
.sidebar nav { display: grid; gap: 5px; margin-top: 30px; }
.side-button { position: relative; width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: flex-start; gap: 13px; padding: 0 15px; border: 0; border-radius: 5px; color: #9aa8ba; background: transparent; }
.side-button span { width: 22px; color: #8292a8; font-size: 18px; line-height: 1; text-align: center; }
.side-button small { font-size: 13px; font-weight: 700; }
.side-button.active { color: #fff; background: rgba(255,255,255,.11); box-shadow: none; }
.side-button.active::before { content: ""; position: absolute; left: 0; width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--brand-red); }
.side-button.active span { color: #fff; }
.side-button:disabled { opacity: .36; }
.topbar { grid-column: 2; position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--business-line); background: rgba(255,255,255,.97); backdrop-filter: blur(12px); }
.topbar-inner { width: 100%; min-height: 70px; padding: 0 34px; }
.app-brand img { width: 84px; }
.app-brand span { color: #415066; font-weight: 700; }
.merchant-identity { color: #344155; }
.merchant-copy small { color: #7b8797; }
.ghost-button, .refresh-button { border-radius: 5px; }
.content { grid-column: 2; width: 100%; margin: 0; padding: 38px 36px 56px; background: var(--business-bg); }
.page-heading { align-items: center; margin-bottom: 24px; }
.page-heading .eyebrow { margin-bottom: 7px; color: var(--brand-blue); }
.page-heading h1 { color: var(--business-text); font-size: clamp(26px, 3vw, 34px); font-weight: 800; letter-spacing: -.035em; }
.page-heading h1 span { color: inherit; }
.subcopy { margin-top: 8px; }
.updated-chip { border-radius: 5px; box-shadow: none; }
.filter-panel, .transactions-panel { border-color: var(--business-line); border-radius: 8px; background: #fff; box-shadow: 0 2px 7px rgba(21,34,51,.035); }
.filter-panel { padding: 22px; }
.quick-ranges { margin-bottom: 20px; }
.range-button { border-radius: 5px; }
.range-button.active { border-color: var(--brand-blue); background: var(--brand-blue); box-shadow: none; }
.search-grid input { border-radius: 5px; }
.primary-button.compact { border-radius: 5px; background: var(--brand-blue); box-shadow: none; }
.summary-grid { gap: 13px; margin: 16px 0; }
.summary-card, .summary-card.navy, .summary-card.red, .summary-card.white { min-height: 148px; padding: 22px; border: 1px solid var(--business-line); border-radius: 8px; color: var(--business-text); background: #fff; box-shadow: 0 2px 7px rgba(21,34,51,.035); }
.summary-card.navy { border-left: 4px solid var(--brand-blue); }
.summary-card.red { border-left: 4px solid var(--brand-red); }
.summary-card.emphasis { border-top: 1px solid var(--business-line); border-left: 4px solid #24806a; }
.summary-card:last-child { border-left: 4px solid #69778a; }
.summary-card p { color: #5c6879; opacity: 1; }
.summary-card strong { color: var(--business-text); font-size: clamp(23px, 2vw, 29px); }
.summary-card > span { color: #7c8796; opacity: 1; }
.summary-icon, .white .summary-icon { width: 30px; height: 30px; border-radius: 5px; color: var(--brand-blue); background: var(--brand-blue-soft); }
.summary-card.red .summary-icon { color: #b71e32; background: #fbecef; }
.summary-card.emphasis .summary-icon { color: #18715c; background: #eaf6f2; }
.summary-card:last-child .summary-icon { color: #536175; background: #eef1f4; }
.mini-chart { display: none; }
.transactions-panel { overflow: hidden; }
.panel-title { padding: 21px 23px; background: #fff; }
.panel-title h2 { color: #202d40; }
th { color: #536175; background: #f7f8fa; border-bottom-color: var(--business-line); }
tbody tr:hover { background: #f7f9fb; }
.transaction-row.cancelled { background: #fff1f4; }
.transaction-row.cancelled:hover { background: #ffe8ed; }
.transaction-row.voided { background: #fff8f9; }
.type-badge, .status-badge { border-radius: 4px; }
.app-shell > footer { grid-column: 2; width: 100%; padding: 19px 36px; border-top: 1px solid var(--business-line); color: #8490a0; background: var(--business-bg); }
.detail-dialog { border-radius: 8px; }
.dialog-close { border-radius: 5px; }
.toast { border-radius: 6px; }

@media (max-width: 1000px) {
  .login-card { grid-template-columns: 1fr 1fr; }
  .login-visual { padding: 46px 42px; }
  .login-panel { padding: 52px 44px; }
  .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .content { padding-inline: 24px; }
}

@media (max-width: 820px) {
  .login-shell { padding: 18px; }
  .login-card { grid-template-columns: 1fr; min-height: auto; }
  .login-visual { display: none; }
  .login-panel { min-height: 620px; padding: 48px 42px; }
  .app-shell { grid-template-columns: 1fr; grid-template-rows: 64px 1fr auto auto; }
  .sidebar { grid-column: 1; grid-row: 4; position: sticky; bottom: 0; z-index: 30; flex-direction: row; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.12); }
  .sidebar-logo { display: none; }
  .sidebar nav { width: 100%; display: flex; justify-content: space-around; gap: 4px; margin: 0; }
  .side-button { width: 72px; min-height: 48px; display: grid; justify-content: center; gap: 2px; padding: 5px; }
  .side-button span { width: auto; font-size: 17px; }
  .side-button small { font-size: 9px; }
  .side-button.active::before { display: none; }
  .topbar, .content, .app-shell > footer { grid-column: 1; }
  .topbar-inner { min-height: 64px; padding: 0 20px; }
  .content { padding: 30px 18px 38px; }
  .app-shell > footer { padding: 17px 20px; }
}

@media (max-width: 520px) {
  .login-shell { padding: 0; }
  .login-card { min-height: 100vh; border: 0; border-radius: 0; }
  .login-panel { min-height: 100vh; padding: 42px 25px; }
  .brand-block { padding-bottom: 22px; }
  .login-panel .login-copy { margin: 38px 0 28px; }
  .login-panel .login-copy h1 { font-size: 30px; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .summary-card, .summary-card.navy, .summary-card.red, .summary-card.white { min-height: 138px; padding: 17px; }
}
