:root{font-family:Inter,"Segoe UI",Arial,sans-serif;color:#24324b;background:#f3f6fb;font-synthesis:none;--navy:#000000;--blue:#254fe8;--muted:#758198;--border:#e5eaf2}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button,a,input,select{outline-offset:4px}button{cursor:pointer}button:disabled{opacity:.55;cursor:wait}a{color:inherit;text-decoration:none}[hidden]{display:none!important}.sidebar{width:236px;position:fixed;inset:0 auto 0 0;background:var(--navy);color:white;padding:36px 20px;display:flex;flex-direction:column}.brand{font-size:34px;font-weight:850;letter-spacing:-1.7px;margin:0 8px 52px}.brand span{color:#22db97}.brand small{display:block;font-size:8px;letter-spacing:1.8px;color:#bdbdbd;margin-top:7px}.nav-label{font-size:10px;letter-spacing:1.8px;color:#a3a3a3;margin:0 12px 12px}.nav{display:flex;align-items:center;gap:12px;background:none;border:0;color:#d4d4d4;width:100%;text-align:left;padding:14px 12px;margin:3px 0;border-radius:7px;font-size:14px}.nav.active{background:#292929;color:white}.nav:hover{background:#202020}.sidebar-bottom{margin-top:auto;font-size:12px;color:#d4d4d4;padding:20px 12px 0;border-top:1px solid #ffffff20}.sidebar-bottom small{display:block;font-size:11px;color:#a3a3a3;margin-top:9px}.secure-dot{display:inline-block;width:7px;height:7px;background:#27dda0;border-radius:50%;margin-right:7px}main{margin-left:236px;padding:0 40px;max-width:1900px}header{min-height:115px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border);gap:20px}.eyebrow{font-size:10px;letter-spacing:1.8px;color:var(--muted);font-weight:700}h1{font-size:25px;margin:8px 0 0;letter-spacing:-.7px}h2{font-size:21px;letter-spacing:-.5px;margin:0 0 8px}h3{font-size:18px;margin:8px 0}p{color:var(--muted);font-size:13px;line-height:1.7;margin:6px 0}.account{display:flex;gap:11px;align-items:center;font-size:12px}.account small{display:block;color:var(--muted);margin-top:5px}.bank-icon{background:#fbe84b;color:#163787;border-radius:8px;padding:13px 10px;font-weight:850}.notice{padding:13px 18px;margin:24px 0;border:1px solid #eadfb9;background:#fffbee;border-radius:7px;color:#86691c;font-size:12px;line-height:1.6}.notice.ready{background:#edf7ff;border-color:#cbdff2;color:#335a7d}.intro,.section-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin:29px 0 22px}.primary,.secondary{border-radius:6px;padding:12px 17px;font-size:12px;font-weight:600;white-space:nowrap;display:inline-flex;justify-content:center;align-items:center;gap:20px}.primary{background:var(--blue);border:1px solid var(--blue);color:white}.primary:hover{background:#1b3fc5}.secondary{background:white;border:1px solid var(--border);color:#3e4d68}.secondary:hover{border-color:#a9b9d7}.card{background:white;border:1px solid var(--border);border-radius:10px;box-shadow:0 3px 15px #172a4903}.check-card{padding:27px 28px}.check-card h3{font-size:22px;letter-spacing:-.5px}#check-form{display:flex;gap:14px;align-items:end;margin-top:24px}label{display:flex;flex-direction:column;gap:8px;font-size:11px;font-weight:600;color:#56627a}input,select{height:44px;border:1px solid #dce3ed;border-radius:5px;padding:0 12px;background:white;color:#24324b;min-width:0;font-size:13px;width:100%}input::placeholder{color:#9aa5b7}.grow{flex:1}#check-form .grow{min-width:270px}#check-form button{height:44px}.section-heading{margin-top:32px}.section-heading h2{font-size:18px}.filters{display:flex;align-items:end;gap:16px;padding:22px}.filters input{max-width:440px}.table-scroll{overflow:auto}table{border-collapse:collapse;width:100%;white-space:nowrap;font-size:12px}th{background:#f9fbfd;color:#7a8597;font-size:11px;font-weight:600;text-align:left;padding:15px 20px;border-block:1px solid var(--border)}td{padding:19px 20px;border-bottom:1px solid #eef1f5}td small{display:block;margin-top:4px;color:var(--muted)}td:nth-child(7){font-family:monospace;font-size:11px}.badge{display:inline-block;padding:6px 9px;border-radius:5px;background:#eff2f8;color:#63718b;font-size:10px}.badge.CONFIRMED{background:#e5f8ef;color:#217552}.badge.AMOUNT_MISMATCH,.badge.REFUND_PENDING,.badge.PARTIALLY_REFUNDED{background:#fff2db;color:#8f691e}.badge.REFUNDED{background:#fce9eb;color:#a4434f}.empty{text-align:center;padding:45px 20px}.empty-icon{font-size:23px;color:#7389be;background:#f1f5fd;width:50px;height:50px;line-height:50px;margin:0 auto 15px;border-radius:12px}.empty h3{font-size:15px}.empty p{font-size:12px}.table-footer{padding:14px 22px;color:#8b95a6;font-size:11px;border-top:1px solid var(--border)}.footnote{font-size:11px;margin-top:17px;max-width:850px}footer{display:flex;gap:20px;flex-wrap:wrap;margin:44px 0 24px;padding-top:20px;border-top:1px solid var(--border);font-size:11px;font-weight:700;color:#8d99ad}footer span,footer small{font-weight:400}footer small{margin-left:auto}.setup-grid{display:grid;grid-template-columns:minmax(0,1fr) 290px;gap:24px;align-items:start}.settings-card{padding:28px;display:grid;gap:16px}.step-heading{display:flex;gap:13px;align-items:start;margin-top:16px}.step-heading:first-child{margin-top:0}.step-heading>span{background:#edf1ff;color:#3153bd;border-radius:50%;width:26px;height:26px;line-height:26px;text-align:center;flex-shrink:0;font-size:12px;font-weight:700}.step-heading h3{font-size:15px;margin:3px 0}.step-heading p{font-size:11px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.form-actions{display:flex;gap:12px;flex-wrap:wrap;border-top:1px solid var(--border);padding-top:22px;margin-top:8px}.setup-help{padding:24px}.setup-help h3{font-size:16px}.setup-help ol{padding-left:19px;color:#63718b;font-size:12px;line-height:1.8}.setup-help li{margin:12px 0}.setup-help p{font-size:12px}.help-note{padding:16px;background:#f5f7fc;border-radius:7px;margin:20px 0;font-size:12px}.result{background:#f3f6fc;border-left:3px solid #7182a5;padding:18px;margin-top:22px;border-radius:5px;font-size:13px;overflow-wrap:anywhere}.result.success{border-color:#1c9a68;background:#eefaf5}.result.error{border-color:#d47836;background:#fff6ed}.result h3{font-size:16px}.result p{color:inherit;font-size:12px}.result dl{display:grid;grid-template-columns:160px 1fr;gap:8px;font-size:12px}.result dt{color:#758198}.result dd{margin:0}code{font-size:11px}@media(min-width:1550px){main{padding:0 55px}}@media(max-width:1100px){.sidebar{width:205px;padding:30px 12px}main{margin-left:205px;padding:0 24px}.setup-grid{grid-template-columns:1fr}.setup-help{max-width:none}#check-form{flex-wrap:wrap}#check-form .grow{flex-basis:100%}.filters{flex-wrap:wrap}}@media(max-width:700px){.sidebar{position:static;width:auto;padding:16px;display:block}.brand{font-size:25px;display:block;margin:0 0 18px}.brand small,.nav-label,.sidebar-bottom{display:none}.nav{display:inline-flex;width:auto;font-size:12px;padding:10px}.nav span{display:inline}main{margin:0;padding:0 16px}header{min-height:105px}.account{font-size:10px}.bank-icon{display:none}h1{font-size:21px}.intro,.section-heading{align-items:start;flex-direction:column}.check-card{padding:20px}#check-form>label,#check-form>button{width:100%}#check-form .grow{min-width:0}.filters{padding:16px}.filters>label{width:100%;flex:auto}.settings-card{padding:20px}.form-grid{grid-template-columns:1fr}.result dl{grid-template-columns:1fr}.result dd{margin-bottom:6px}footer small{margin-left:0}}

.document-type{margin-left:10px;padding:3px 7px;border-radius:4px;background:#edf0f4;color:#56627a;font-size:10px;font-weight:600}.wrap-cell{white-space:normal;min-width:160px;max-width:260px;overflow-wrap:anywhere}tbody tr:nth-child(odd){background:#f8fafc}

/* Keep the application within the viewport; scroll records independently. */
html, body { height: 100%; overflow: hidden; }
body { height: 100dvh; display: flex; flex-direction: column; }
main { height: 100%; min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
main > header { flex: 0 0 auto; min-height: 90px; }
#payments-view { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#payments-view > .section-heading { flex-shrink: 0; margin: 20px 0 12px; }
#sync-status { flex-shrink: 0; margin: 0 0 10px; }
#payments-view > #result { flex-shrink: 0; max-height: 100px; overflow: auto; margin-top: 10px; }
.history-card { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.history-card > .filters { flex: 0 0 auto; padding: 16px 22px; }
.table-scroll { flex: 1; min-height: 0; min-width: 0; overflow: auto; scrollbar-gutter: stable; overscroll-behavior: contain; }
.table-scroll table { border-collapse: separate; border-spacing: 0; }
.table-scroll th { position: sticky; top: 0; z-index: 1; background: #f9fbfd; box-shadow: 0 1px 0 var(--border); }
.table-scroll:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.table-footer { flex: 0 0 auto; padding: 10px 22px; }
#payments-view > .footnote { flex-shrink: 0; margin: 8px 0 0; }
main > footer { flex: 0 0 auto; margin: 12px 0; padding-top: 10px; }
#settings-view { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding-bottom: 16px; }
@media (max-width: 700px) {
  .sidebar { flex: 0 0 auto; padding: 10px 16px; }
  .brand { margin-bottom: 6px; }
  main { flex: 1; height: auto; }
  main > header { min-height: 70px; }
  #payments-view > .section-heading { flex-direction: row; align-items: center; margin: 10px 0 6px; }
  .section-heading p { display: none; }
  #sync-status { font-size: 10px; line-height: 1.4; margin-bottom: 6px; }
  .history-card > .filters { flex-wrap: nowrap; overflow-x: auto; padding: 10px; gap: 10px; }
  .filters > label { flex: 0 0 180px; width: 180px; }
  .filters > button { flex-shrink: 0; }
  #payments-view > .footnote { font-size: 9px; line-height: 1.3; }
  main > footer { margin: 6px 0; padding-top: 6px; gap: 6px; }
  main > footer small { display: none; }
}
@media (max-height: 600px) {
  main > header { min-height: 60px; }
  #payments-view > .section-heading { margin: 8px 0 4px; }
  .history-card > .filters { padding-top: 8px; padding-bottom: 8px; }
  main > footer { display: none; }
  #payments-view > .footnote { max-height: 28px; overflow: auto; }
}
.sort-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sort-button:hover { color: var(--blue); }
.sort-indicator { font-size: 10px; opacity: .6; }
th[aria-sort="ascending"] .sort-button, th[aria-sort="descending"] .sort-button { color: var(--blue); }
th[aria-sort="ascending"] .sort-indicator, th[aria-sort="descending"] .sort-indicator { opacity: 1; }
#period-hint { flex-shrink: 0; font-size: 11px; margin: 0 0 6px; }
.filters input[type="date"] { min-width: 145px; }
.history-card > .filters { flex-wrap: nowrap; overflow-x: auto; }
.history-card > .filters > label { flex-shrink: 0; }
.history-card > .filters > .grow { min-width: 200px; }
.history-card > .filters > button { flex-shrink: 0; }

/* Phone layout: compact navigation, expandable filters and readable records. */
.mobile-filters-toggle, .mobile-sort { display: none; }
@media (max-width: 700px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; padding: 10px 12px; }
  .brand { grid-column: 1 / -1; font-size: 24px; margin: 0; }
  .nav { width: 100%; min-height: 44px; margin: 0; padding: 8px; justify-content: center; font-size: 12px; gap: 6px; }
  main { padding: 0 12px; }
  main > header { min-height: 72px; gap: 8px; }
  header .eyebrow { display: none; }
  h1 { font-size: 18px; margin: 0; }
  .account { max-width: 48%; min-width: 0; font-size: 10px; }
  .account strong { display: block; overflow-wrap: anywhere; }
  .section-heading h2 { font-size: 16px; margin: 0; }
  .primary, .secondary { min-height: 44px; font-size: 13px; }
  #period-hint { font-size: 10px; line-height: 1.3; margin: 0 0 4px; }
  #sync-status { max-height: 42px; overflow: auto; font-size: 10px; }
  .mobile-filters-toggle { display: block; flex: 0 0 auto; min-height: 44px; text-align: left; border: 0; border-bottom: 1px solid var(--border); background: #fff; padding: 10px 14px; color: #24324b; font-weight: 600; }
  .history-card > .filters { display: none; }
  .history-card > .filters.mobile-open { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; padding: 12px; overflow: auto; max-height: 32dvh; flex: 0 0 auto; }
  .history-card > .filters > label, .history-card > .filters > .grow { width: auto; min-width: 0; }
  .history-card > .filters > .grow { grid-column: 1 / -1; }
  .filters input[type="date"] { min-width: 0; padding: 0 6px; }
  input, select { font-size: 16px; min-height: 44px; }
  label { font-size: 12px; }
  .filters input { max-width: none; }
  .mobile-sort { display: flex; flex: 0 0 auto; flex-direction: row; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 12px; }
  .mobile-sort select { flex: 1; min-width: 0; width: auto; font-size: 14px; }
  .table-scroll { scrollbar-gutter: auto; background: #f3f6fb; padding: 10px; }
  .table-scroll table, .table-scroll tbody { display: block; width: 100%; }
  .table-scroll thead { display: none; }
  .table-scroll tbody tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); background: white; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; padding: 4px 12px; }
  .table-scroll td { display: block; min-width: 0; max-width: none; padding: 9px 0; white-space: normal; overflow-wrap: anywhere; font-size: 13px; border: 0; }
  .table-scroll td::before { content: attr(data-label); display: block; color: #758198; font-family: "Segoe UI",sans-serif; font-size: 10px; font-weight: 600; margin-bottom: 5px; }
  .table-scroll td:nth-child(2) { text-align: right; font-size: 18px; font-weight: 700; }
  .table-scroll td:nth-child(4) { grid-column: 1 / -1; grid-row: 2; font-weight: 600; border-top: 1px solid var(--border); }
  .table-scroll td:nth-child(3) { grid-row: 3; }
  .table-scroll td:nth-child(6) { grid-row: 3; text-align: right; }
  .table-scroll td:nth-child(5), .table-scroll td:nth-child(7), .table-scroll td:nth-child(8) { grid-column: 1 / -1; border-top: 1px solid #f1f3f7; }
  .table-scroll td:nth-child(7) { font-size: 11px; }
  .badge { white-space: normal; line-height: 1.4; font-size: 11px; }
  .table-footer { padding: 9px 12px; font-size: 10px; }
  #payments-view > .footnote { max-height: 24px; overflow: auto; font-size: 9px; margin-top: 5px; }
  main > footer { display: none; }
  .settings-card, .setup-help { padding: 16px; }
  .settings-card label, .setup-help { min-width: 0; }
  .form-actions { display: grid; grid-template-columns: 1fr; }
  #settings-view .intro { margin: 16px 0; gap: 8px; }
  #settings-view .intro h2 { font-size: 18px; }
  #settings-view { overflow-x: hidden; }
}
@media (max-width:700px) and (max-height:500px) {
  .sidebar { display: flex; align-items: center; padding: 4px 10px; }
  .brand { flex: 0 0 auto; }
  main > header { min-height: 48px; }
  #period-hint, #payments-view > .footnote { display: none; }
  .mobile-sort, .mobile-filters-toggle { min-height: 36px; padding-top: 3px; padding-bottom: 3px; }
}
@media (max-width:700px) {
  .history-card > .filters.mobile-open { max-height: min(240px, 26dvh); }
  .history-card:has(.filters.mobile-open) > .mobile-sort { display: none; }
}

#payments-view > .section-heading { justify-content: flex-end; }

#payments-view > .history-card { margin-top: 16px; }
@media(max-width:700px){ .history-card > .filters > #refresh { grid-column: 2; grid-row: 3; } .history-card > .filters > #export { grid-column: 1 / -1; } }
/* Expanded phone filters use the card area instead of a narrow scroll strip. */
@media (max-width: 700px) {
  .history-card > .filters.mobile-open {
    flex: 1 1 0; min-height: 0; max-height: none;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-auto-rows: min-content; align-content: start;
    overflow-y: auto; overflow-x: hidden; padding: 16px 12px; gap: 16px 10px;
    overscroll-behavior: contain;
  }
  .history-card:has(.filters.mobile-open) > .table-scroll,
  .history-card:has(.filters.mobile-open) > .mobile-sort { display: none; }
  .history-card > .filters > label { min-width: 0; width: 100%; gap: 8px; }
  .history-card > .filters > label:nth-of-type(1) { grid-column: 1 / -1; grid-row: 1; }
  .history-card > .filters > label:nth-of-type(2) { grid-column: 1; grid-row: 2; }
  .history-card > .filters > label:nth-of-type(3) { grid-column: 2; grid-row: 2; }
  .history-card > .filters > label:nth-of-type(4) { grid-column: 1 / -1; grid-row: 3; }
  .history-card > .filters input, .history-card > .filters select { min-width: 0; width: 100%; max-width: 100%; height: 48px; font-size: 16px; }
  .history-card > .filters > #refresh { grid-column: 1; grid-row: 4; background: var(--blue); color: white; border-color: var(--blue); }
  .history-card > .filters > #export { grid-column: 2; grid-row: 4; background: white; color: var(--blue); border-color: var(--border); }
  .history-card > .filters > button { min-width: 0; width: 100%; min-height: 48px; padding: 10px 6px; font-size: 12px; white-space: normal; }
  .mobile-filters-toggle { min-height: 48px; font-size: 14px; }
}
.mobile-details-toggle { display: none; }
@media (max-width: 700px) {
  .table-scroll td.mobile-transaction-detail { display: none; }
  .table-scroll tr.details-expanded > td.mobile-transaction-detail {
    display: block; grid-column: 1 / -1; grid-row: auto; text-align: left;
    border-top: 1px solid #f1f3f7;
  }
  .mobile-details-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    min-height: 44px; margin-top: 8px; padding: 8px 10px;
    border: 1px solid var(--border); border-radius: 6px;
    background: #f8fafc; color: var(--blue); font-size: 13px; font-weight: 600;
  }
}
@media (max-width:700px) {
  .history-card > .filters > #search-button { grid-column: 1 / -1; grid-row: 4; }
  .history-card > .filters > #refresh { grid-column: 1; grid-row: 5; }
  .history-card > .filters > #export { grid-column: 2; grid-row: 5; }
}

/* Phone cards show the payment status beside the payer name. */
@media (max-width:700px) {
  .table-scroll td:nth-child(4) { grid-column: 1; grid-row: 3; padding-right: 10px; }
  .table-scroll td:nth-child(6) { grid-column: 2; grid-row: 3; border-top: 1px solid var(--border); }
  .table-scroll td:nth-child(5) { display: none; }
  .table-scroll td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width:700px) {
  .mobile-details-toggle { width: 44px; height: 44px; margin-left: auto; justify-content: center; padding: 0; font-size: 24px; }
  .table-scroll .payer-name { touch-action: manipulation; }
  .table-scroll tr.details-expanded > td:nth-child(5) { display: block; }
}

/* Keep payer identity and status together on phone cards. */
@media (max-width:700px) {
  .table-scroll tbody tr { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .table-scroll td:nth-child(1) { grid-column: 1 / 4; grid-row: 1; }
  .table-scroll td:nth-child(2) { grid-column: 4 / 7; grid-row: 1; }
  .table-scroll td:nth-child(4) { grid-column: 1 / 3; grid-row: 2; padding-right: 8px; }
  .table-scroll td:nth-child(3) { grid-column: 3 / 5; grid-row: 2; padding-right: 8px; border-top: 1px solid var(--border); font-size: 11px; }
  .table-scroll td:nth-child(6) { grid-column: 5 / 7; grid-row: 2; }
  .table-scroll td:nth-child(6) .badge { max-width: 100%; box-sizing: border-box; padding: 6px; font-size: 10px; }
}

@media (max-width:700px) {
  .table-scroll tbody tr { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) minmax(0, .85fr); }
  .table-scroll td:nth-child(1) { grid-column: 1 / 3; }
  .table-scroll td:nth-child(2) { grid-column: 3; }
  .table-scroll td:nth-child(4) { grid-column: 1; }
  .table-scroll td:nth-child(3) { grid-column: 2; }
  .table-scroll td:nth-child(6) { grid-column: 3; }
}

@media (max-width:700px) { .table-scroll tbody tr { touch-action: manipulation; } }

.account-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-heading #refresh { flex: 0 0 auto; }
main:has(#payments-view[hidden]) .account-heading #refresh { display: none; }
@media (max-width:700px) {
  main > header { flex-wrap: wrap; padding: 10px 0; gap: 8px; }
  main > header > div:first-child { width: 100%; }
  .account { max-width: none; width: 100%; }
  .account > div { width: 100%; min-width: 0; }
  .account-heading { gap: 8px; }
  .account-heading #account-name { flex: 1; min-width: 0; }
  .account-heading #refresh { min-height: 44px; padding: 8px 10px; }
  .history-card > .filters > #export { grid-column: 1 / -1; grid-row: 5; }
}

@media (max-width:700px) {
  .account-heading #refresh {
    width: 44px; min-height: 44px; padding: 0; gap: 0;
    border-color: transparent; background: transparent; box-shadow: none;
    color: var(--muted); font-size: 0;
  }
  .account-heading #refresh::before { content: '↻'; font-size: 20px; line-height: 1; }
  .account-heading #refresh:hover { color: var(--blue); background: #edf1f8; }
  .account-heading #refresh:disabled::before { animation: refresh-turn 1s linear infinite; }
}
@keyframes refresh-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .account-heading #refresh:disabled::before { animation: none; } }

@media (max-width:700px) { .sidebar .nav { display: none; } }

@media (max-width:700px) {
  .account-heading #refresh {
    width: auto; min-height: 44px; padding: 8px 12px;
    font-size: 12px; color: var(--blue);
    border-color: var(--border); background: white;
  }
  .account-heading #refresh::before { content: none; }
}

/* Compact, touch-friendly filter form. */
@media (max-width:700px) {
  .history-card > .filters.mobile-open { padding: 14px; gap: 14px 10px; background: #f9fbfd; }
  .history-card > .filters > label { font-size: 12px; color: #43516a; gap: 6px; }
  .history-card > .filters input, .history-card > .filters select { border-radius: 8px; padding: 0 10px; background: white; }
  .history-card > .filters > #search-button { grid-column: 1; grid-row: 4; }
  .history-card > .filters > #clear-filters { grid-column: 2; grid-row: 4; background: white; color: #43516a; }
  .history-card > .filters > #export { grid-column: 1 / -1; grid-row: 5; min-height: 44px; }
  .history-card > .filters > button { border-radius: 8px; font-size: 14px; }
  .mobile-filters-toggle { padding: 12px 14px; text-align: left; }
}
@media (max-width:360px) {
  .history-card > .filters input[type="date"] { font-size: 14px; padding: 0 5px; }
}

/* Stack date controls so native mobile date inputs cannot overlap. */
@media (max-width:700px) {
  .history-card > .filters > label:nth-of-type(2) { grid-column: 1 / -1; grid-row: 2; }
  .history-card > .filters > label:nth-of-type(3) { grid-column: 1 / -1; grid-row: 3; }
  .history-card > .filters > label:nth-of-type(4) { grid-column: 1 / -1; grid-row: 4; }
  .history-card > .filters input[type="date"] { display: block; box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; font-size: 16px; padding: 0 10px; }
  .history-card > .filters > #search-button { grid-column: 1; grid-row: 5; }
  .history-card > .filters > #clear-filters { grid-column: 2; grid-row: 5; }
  .history-card > .filters > #export { grid-column: 1 / -1; grid-row: 6; }
}

@media (max-width:700px) { .history-card > .filters input[type="date"] { font-size: 14px; } }

/* Two equal date columns, including native date controls on small phones. */
@media (max-width:700px) {
  .history-card > .filters.mobile-open { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .history-card > .filters > label:nth-of-type(2) { grid-column: 1; grid-row: 2; overflow: hidden; }
  .history-card > .filters > label:nth-of-type(3) { grid-column: 2; grid-row: 2; overflow: hidden; }
  .history-card > .filters > label:nth-of-type(4) { grid-column: 1 / -1; grid-row: 3; }
  .history-card > .filters input[type="date"] {
    appearance: none; -webkit-appearance: none;
    width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box;
    font-size: 13px; padding: 0 6px; overflow: hidden;
  }
  .history-card > .filters input[type="date"]::-webkit-date-and-time-value { min-width: 0; text-align: left; }
  .history-card > .filters input[type="date"]::-webkit-datetime-edit { min-width: 0; padding: 0; }
  .history-card > .filters input[type="date"]::-webkit-calendar-picker-indicator { margin: 0; padding: 2px; width: 14px; flex-shrink: 0; }
  .history-card > .filters > #search-button { grid-column: 1; grid-row: 4; }
  .history-card > .filters > #clear-filters { grid-column: 2; grid-row: 4; }
  .history-card > .filters > #export { grid-column: 1 / -1; grid-row: 5; }
}

@media (max-width:700px) { .history-card > .filters input[type="date"] { font-size: 15px; padding: 0 4px; } }

@media (max-width:700px) {
  .history-card > .filters input[type="date"] { text-align: center; height: 48px; line-height: normal; }
  .history-card > .filters input[type="date"]::-webkit-date-and-time-value { text-align: center; margin: 0; line-height: 46px; }
  .history-card > .filters input[type="date"]::-webkit-datetime-edit { display: inline-flex; align-items: center; justify-content: center; padding: 0; height: 100%; }
  .history-card > .filters input[type="date"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
}

/* Consistent filter typography on phones. */
@media (max-width:700px) {
  .history-card > .filters > label { font-family: inherit; font-size: 12px; font-weight: 600; }
  .history-card > .filters input,
  .history-card > .filters input[type="date"],
  .history-card > .filters select,
  .history-card > .filters > button { font-family: inherit; font-size: 15px; }
  .history-card > .filters input,
  .history-card > .filters select { font-weight: 400; }
  .history-card > .filters > button { font-weight: 600; }
  .mobile-filters-toggle, .mobile-sort select { font-family: inherit; font-size: 15px; }
  .mobile-sort { font-family: inherit; font-size: 12px; font-weight: 600; }
}

@media (max-width:700px) { .history-card > .filters #status-filter { text-align: center; text-align-last: center; } }

/* Fit the phone viewport; only inner panels scroll by touch. */
@media (max-width:700px) {
  html { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
  body {
    position: fixed; inset: 0; width: 100%; max-width: 100%;
    height: 100%; height: 100dvh; min-height: 0; overflow: hidden;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    overscroll-behavior: none;
  }
  .sidebar { width: 100%; min-width: 0; padding: 8px 12px; }
  main { flex: 1 1 0; width: 100%; max-width: 100%; min-width: 0; min-height: 0; margin: 0; padding: 0 10px 8px; overflow: hidden; }
  main > header { padding: 8px 0; }
  #payments-view, .history-card { min-width: 0; min-height: 0; max-width: 100%; }
  #payments-view > .history-card { margin-top: 8px; }
  .table-scroll, .history-card > .filters.mobile-open, #settings-view {
    overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .table-scroll::-webkit-scrollbar,
  .history-card > .filters.mobile-open::-webkit-scrollbar,
  #settings-view::-webkit-scrollbar { display: none; }
  .table-scroll table { table-layout: fixed; min-width: 0; max-width: 100%; }
  .table-scroll td { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .history-card > .filters input,
  .history-card > .filters input[type="date"],
  .history-card > .filters select { font-size: 16px; }
}

.pix-extra-details { margin-top: 10px; font-size: 12px; }
.pix-extra-details summary { cursor: pointer; color: var(--blue); padding: 6px 0; }
.pix-extra-details dl { margin: 8px 0 0; white-space: normal; }
.pix-extra-details dt { color: var(--muted); font-size: 11px; margin-top: 10px; }
.pix-extra-details dd { margin: 4px 0 0; overflow-wrap: anywhere; }
@media (max-width:700px) { .pix-extra-details summary { display: none; } .pix-extra-details { font-size: 13px; } }

.pagination { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.pagination > div { display: flex; gap: 8px; }
.pagination button:disabled { cursor: default; }
@media (max-width:700px) {
 .pagination { padding: 6px 8px; gap: 6px; font-size: 10px; }
 .pagination .secondary { min-height: 44px; padding: 8px; font-size: 12px; }
 .pagination > div { gap: 4px; flex-shrink: 0; }
 .history-card:has(.filters.mobile-open) > .pagination { display: none; }
}
/* Login e administração PPIX. */
.auth-pending > .sidebar,.auth-pending > main { display:none!important; }
.login-screen { position:fixed;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;padding:24px;background:#f3f8fc;overflow:auto; }
.login-card { width:420px;max-width:100%;padding:36px;border:1px solid #d5e2ee;border-radius:18px;background:white;box-shadow:0 24px 64px #243b531a;text-align:center; }
.login-logo { width:58px;height:58px;border-radius:16px;background:#101b2d;box-shadow:0 12px 24px #101b2d35;color:white;font-size:32px;font-weight:850;line-height:58px;margin:0 auto 20px; }
.login-logo span { color:#20ce88; }
.login-card h1 { font-size:32px;letter-spacing:-1px;color:#10233b;margin:0 0 8px; }
.login-subtitle { font-size:15px;color:#71829a;margin:0 0 24px; }
#login-form { display:grid;gap:17px;text-align:left; }
#login-form label { color:#304761;font-size:12px;gap:7px; }
#login-form input { background:#f8fbff;border-color:#ccdbeb;border-radius:9px; }
#login-form input:focus { outline:2px solid #119c5840;border-color:#109d55; }
#login-form .remember,.check-label { display:flex;flex-direction:row;align-items:center;gap:10px; }
#login-form .remember input,.check-label input { width:17px;height:17px;min-height:17px;accent-color:#109d55;flex-shrink:0; }
.login-submit { width:100%;padding:13px;background:#109d4e;border:0;border-radius:9px;color:white;font-size:15px;font-weight:700;box-shadow:0 8px 18px #109d4e26; }
.login-submit:hover { background:#0d8944; }
.login-card > small { display:block;color:#8492a4;font-size:11px;margin-top:22px; }
.login-error { font-size:13px;color:#a23c30;line-height:1.5; }
.user-panel { margin-top:auto;padding:20px 10px;color:white;font-size:13px; }
.user-panel small { display:block;color:#a3a3a3;margin-top:5px; }
.user-panel .nav { margin-top:12px;padding-left:0; }
.sidebar-bottom { margin-top:0; }
.account-selector { padding-top:16px;flex-shrink:0; }
.account-selector label { max-width:480px; }
#admin-view { flex:1;min-height:0;overflow:auto;padding-bottom:28px; }
.admin-tabs { display:flex;gap:10px;margin-bottom:20px;flex-wrap:wrap; }
.admin-tabs .active { border-color:#254fe8;background:#edf1ff;color:#254fe8; }
.admin-layout { display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,440px);gap:24px;align-items:start; }
.admin-form { display:grid;gap:16px;padding:24px; }
.admin-form h3 { margin:0 0 8px; }
.admin-list { overflow:hidden; }
.admin-list-heading { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px;border-bottom:1px solid var(--border); }
.admin-list-heading h3 { font-size:15px; }
.registration-row { width:100%;border:0;border-bottom:1px solid var(--border);background:white;display:flex;flex-direction:column;align-items:start;gap:8px;padding:20px;text-align:left; }
.registration-row:hover { background:#f5f8fc; }
.registration-row small { color:var(--muted); }
.admin-empty { padding:24px; }
.admin-form fieldset { border:1px solid var(--border);border-radius:8px;padding:14px; }
.admin-form legend { font-size:12px;color:#56627a; }
#user-companies { display:grid;gap:12px; }
@media(max-width:1000px) { .admin-layout { grid-template-columns:1fr; } }
@media(max-width:700px) {
 .login-screen { padding:20px; }.login-card { padding:30px 24px; }
 .sidebar .nav { display:flex; }.sidebar { grid-template-columns:1fr 1fr; }.sidebar .brand { margin:0; }.sidebar .user-panel { grid-column:1/-1;display:flex;align-items:center;gap:10px;padding:4px 0; }.user-panel .nav { margin:0 0 0 auto;width:auto;min-height:32px;font-size:11px; }.user-panel small { margin:0; }.sidebar .nav-label { display:none; }
 .account-selector { padding-top:8px; }.account-selector label { font-size:11px; }
 .admin-form { padding:18px; }.admin-list-heading { flex-wrap:wrap; }.admin-tabs { gap:6px; }
}
/* Discreet signed-in identity in the top-right corner. */
.header-actions { display:flex;align-items:center;justify-content:flex-end;gap:24px;min-width:0; }
header .user-panel { flex:0 0 auto;margin:0;padding:0 0 0 18px;border-left:1px solid var(--border);text-align:right;color:#56627a;font-size:12px;max-width:180px; }
header .user-panel strong { display:block;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
header .user-panel small { margin-top:3px;color:#8792a3;font-size:10px;font-weight:400; }
.sidebar .sidebar-logout { margin-top:auto;font-size:12px; }
@media(max-width:700px) {
 main > header { position:relative; }
 main > header > div:first-child { width:auto;max-width:calc(100% - 130px); }
 .header-actions { display:contents; }
 header .user-panel { position:absolute;top:10px;right:0;max-width:120px;border:0;padding:0;font-size:11px; }
 header .user-panel small { font-size:10px; }
 .sidebar .sidebar-logout { margin:0;min-height:32px;font-size:11px; }
}
/* Icon-only sign out, accessible by keyboard and screen reader. */
.logout-icon { display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:36px;height:36px;border:0;border-radius:8px;background:transparent;color:#8792a3;padding:0; }
.logout-icon:hover { background:#e9eef6;color:#394b64; }
.logout-icon:focus-visible { outline:2px solid var(--blue);outline-offset:2px; }
.header-actions { gap:14px; }
@media(max-width:700px) {
 header .logout-icon { position:absolute;top:5px;right:0;width:44px;height:44px; }
 header .user-panel { right:48px;max-width:110px; }
 main > header > div:first-child { max-width:calc(100% - 170px); }
}
/* Sign out at the lower left of the sidebar. */
.sidebar > .sidebar-logout { margin-top:auto;margin-bottom:8px;padding:12px;font-size:12px;color:#d4d4d4;text-align:left;justify-content:flex-start; }
.sidebar > .sidebar-bottom { margin-top:0; }
@media(max-width:700px) {
 .sidebar > .sidebar-logout { position:fixed;bottom:env(safe-area-inset-bottom,0px);left:0;z-index:10;width:auto;min-height:40px;margin:0;padding:10px 14px;background:#000;color:#d4d4d4;border-radius:0 6px 0 0;font-size:11px; }
 main { padding-bottom:44px; }
}
/* Mobile navigation keeps the panel focused on receipts. */
@media (max-width:700px) {
 .sidebar > button[data-view="admin"],
 .sidebar > button[data-view="payments"],
 .sidebar > button[data-view="settings"] { display:none!important; }
}
/* Smaller account selector on phones. */
@media(max-width:700px) {
 .account-selector label { font-size:10px;font-weight:500;color:#8792a3;gap:4px; }
 .account-selector select { font-size:12px;min-height:36px;height:36px;padding:0 8px;color:#63718a;border-color:#e5eaf2;background:#f8fafc; }
}
@media(max-width:700px) {
 .account-selector select { font-weight:700; }
}
/* The selected Pix account is already identified in the mobile selector. */
@media(max-width:700px) {
 header .account #account-name { display:none; }
}
/* Phone-only sign-out icon beside the signed-in user. */
#logout-mobile { display:none; }
@media(max-width:700px) {
 #logout-mobile { display:inline-flex; }
 .sidebar > .sidebar-logout { display:none!important; }
 main { padding-bottom:8px; }
}
/* Sign out beside the user identity on all screen sizes. */
header #logout-mobile { display:inline-flex; }
.report-download { display:flex;align-items:center;gap:8px;flex-shrink:0; }
.report-download select { width:88px; }
@media(max-width:700px) {
 main > header { min-height:104px;align-content:flex-start;padding-top:12px; }
 header .account { position:absolute;top:48px;right:0;width:auto;max-width:none; }
 header .account-heading #refresh { min-height:36px;padding:6px 10px;font-size:11px; }
 .history-card > .filters > label,.mobile-sort { font-size:10px;font-weight:500; }
 .history-card > .filters input,.history-card > .filters input[type="date"],.history-card > .filters select { font-size:12px; }
 .mobile-sort select { font-size:12px; }
 .mobile-filters-toggle { font-size:12px; }
 .history-card > .filters > button { font-size:12px; }
 .history-card > .filters > .report-download { grid-column:1/-1;grid-row:6;min-width:0; }
 .report-download #export-format { flex:0 0 84px;width:84px;min-width:0;font-size:12px; }
 .report-download #export { flex:1;min-width:0;font-size:12px; }
}
/* Company selector and refresh share one compact row on phones. */
@media(max-width:700px) {
 main > header { min-height:64px; }
 header .account { display:none; }
 .account-selector { display:flex;align-items:flex-end;gap:8px; }
 .account-selector > label { flex:1;min-width:0;max-width:none; }
 .account-selector > #refresh { flex:0 0 auto;min-height:36px;height:36px;padding:6px 10px;font-size:11px;border-color:var(--border);background:white;color:var(--blue); }
}
/* Reports dashboard. */
#reports-view { flex:1;min-height:0;overflow:auto;padding:24px 0 28px; }
.reports-heading { display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:22px; }
.reports-heading h2 { margin-top:8px; }
.dashboard-toolbar { display:flex;align-items:flex-end;gap:14px;padding:18px;background:white;border:1px solid var(--border);border-radius:10px; }
.dashboard-toolbar label { min-width:150px; }
#dashboard-notice { margin:16px 0;font-size:12px; }
.period-cards { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:16px 0; }
.status-cards { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:20px; }
.metric-card { background:white;border:1px solid var(--border);border-radius:10px;padding:20px;min-width:0; }
.metric-card > span { font-size:12px;color:#758198; }
.metric-card > strong { display:block;font-size:24px;letter-spacing:-.6px;margin:12px 0 8px;overflow-wrap:anywhere; }
.metric-card > small { display:block;font-size:11px;color:#8792a3;line-height:1.5; }
.metric-card.confirmed strong { color:#169b72; }.metric-card.refunded strong { color:#c75060; }.metric-card.pending strong { color:#b18024; }
.dashboard-charts { display:grid;grid-template-columns:minmax(0,2fr) minmax(240px,1fr);gap:18px; }
.dashboard-chart { padding:22px;min-width:0; }.dashboard-chart h3 { font-size:15px;margin:0 0 6px; }
#dashboard-bars svg,#dashboard-distribution svg { display:block;width:100%;height:auto;font-family:inherit; }
.chart-legend { display:flex;gap:14px;flex-wrap:wrap;margin:16px 0;font-size:11px;color:#758198; }
.chart-legend span::before { content:'';display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:6px;background:#169b72; }.chart-legend .refunded::before { background:#dd6471; }.chart-legend .pending::before { background:#d39b35; }
.distribution-legend { display:flex;flex-wrap:wrap;justify-content:center;gap:0 12px; }.distribution-legend p { font-size:11px; }
.dashboard-footnote { font-size:11px;margin-top:16px; }
main:has(#reports-view:not([hidden])) #refresh { display:none; }
@media(max-width:1100px) { .status-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }.dashboard-charts { grid-template-columns:1fr; } }
@media(max-width:700px) {
 #reports-view { padding-top:16px; }.reports-heading { align-items:flex-start;gap:10px; }.reports-heading h2 { font-size:20px; }.reports-heading p { font-size:11px; }.reports-heading > button { font-size:10px;padding:8px;white-space:normal; }
 .dashboard-toolbar { display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px; }.dashboard-toolbar label { min-width:0;font-size:10px; }.dashboard-toolbar input,.dashboard-toolbar select { font-size:12px; }.dashboard-toolbar button { grid-column:1/-1;font-size:12px; }
 .period-cards { grid-template-columns:1fr;gap:8px; }.metric-card { padding:14px; }.period-cards .metric-card { display:grid;grid-template-columns:50px 1fr;align-items:center;gap:6px; }.period-cards .metric-card strong { font-size:20px;margin:0;text-align:right; }.period-cards .metric-card small { grid-column:1/-1; }
 .status-cards { gap:8px; }.status-cards strong { font-size:19px; }.metric-card > span { font-size:10px; }.metric-card > small { font-size:10px; }.dashboard-chart { padding:14px; }#dashboard-bars { overflow:auto; }#dashboard-bars svg { min-width:600px; }
 .sidebar > button[data-view="reports"] { padding:8px 12px;min-height:36px;font-size:12px;grid-column:1/-1; }
}
/* Black login screen with the supplied PPIX wordmark. */
.login-screen { background:#000; }
.login-card { background:#000;border-color:#242424;box-shadow:0 24px 64px #0006; }
.login-card h1.login-brand { margin:0 auto 20px;font-size:0;line-height:1; }
.login-brand img { display:block;width:144px;max-width:100%;height:auto;margin:0 auto; }
.login-subtitle { color:#929c98; }
#login-form label { color:#d0d6d3; }
#login-form input { background:#141414;border-color:#333;color:#f4f6f5;color-scheme:dark; }
#login-form input::placeholder { color:#747e79; }
#login-form input:focus { outline:2px solid #22db9740;border-color:#22b87c; }
.login-card > small { color:#747e79; }
.login-error { color:#ff9a91; }
/* Persistent light/dark appearance, independent of account permissions. */
.theme-icon .theme-sun { display:none; }
:root[data-theme="dark"] .theme-icon .theme-sun { display:block; }
:root[data-theme="dark"] .theme-icon .theme-moon { display:none; }
:root[data-theme="dark"] { color-scheme:dark;background:#101318;color:#e1e7ee;--border:#303844;--muted:#a0adbd;--blue:#7898ff; }
:root[data-theme="dark"] body { background:#101318;color:#e1e7ee; }
:root[data-theme="dark"] main .card,
:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .dashboard-toolbar,
:root[data-theme="dark"] .registration-row { background:#191e26;border-color:var(--border);color:#e1e7ee; }
:root[data-theme="dark"] main input,
:root[data-theme="dark"] main select { background:#151a22;color:#e1e7ee;border-color:#394453; }
:root[data-theme="dark"] main label,
:root[data-theme="dark"] header .user-panel { color:#b1becf; }
:root[data-theme="dark"] main p,
:root[data-theme="dark"] .metric-card > span,
:root[data-theme="dark"] .metric-card > small { color:#a0adbd; }
:root[data-theme="dark"] .table-scroll,
:root[data-theme="dark"] .table-scroll tbody tr { background:#191e26;border-color:#303844; }
:root[data-theme="dark"] tbody tr:nth-child(odd) { background:#1e2530; }
:root[data-theme="dark"] th { background:#242d39;color:#becadb;border-color:#303844; }
:root[data-theme="dark"] td { border-color:#303844; }
:root[data-theme="dark"] .secondary,
:root[data-theme="dark"] .mobile-filters-toggle,
:root[data-theme="dark"] .mobile-sort,
:root[data-theme="dark"] .history-card > .filters.mobile-open { background:#1b232f;color:#becadb;border-color:#394453; }
:root[data-theme="dark"] main .primary { background:#315bea;color:white; }
:root[data-theme="dark"] .logout-icon { color:#a0adbd; }
:root[data-theme="dark"] .logout-icon:hover { background:#293343;color:#f1f5fb; }
:root[data-theme="dark"] .help-note,
:root[data-theme="dark"] .empty-icon { background:#242d39;color:#becadb; }
:root[data-theme="dark"] .notice { background:#30291a;border-color:#64512c;color:#ead19a; }
:root[data-theme="dark"] .notice.ready { background:#192b3c;border-color:#34536b;color:#b0d5ef; }
:root[data-theme="dark"] .result.error { background:#35251c;color:#ffd4b5; }
:root[data-theme="dark"] .result.success { background:#17372d;color:#b6edd4; }
:root[data-theme="dark"] .badge.CONFIRMED { background:#173c30;color:#82deb5; }
:root[data-theme="dark"] .badge.REFUNDED { background:#48252d;color:#ffacb7; }
:root[data-theme="dark"] .badge.REFUND_PENDING { background:#41351f;color:#f1d491; }
:root[data-theme="dark"] .metric-card.confirmed strong { color:#69d9b2; }
:root[data-theme="dark"] .metric-card.refunded strong { color:#ff9eae; }
:root[data-theme="dark"] .metric-card.pending strong { color:#e7c16c; }
:root[data-theme="dark"] #dashboard-bars svg text,
:root[data-theme="dark"] #dashboard-distribution svg text { fill:#b8c7d9; }
:root[data-theme="dark"] #dashboard-bars svg line { stroke:#354151; }
:root[data-theme="dark"] .registration-row:hover { background:#242d39; }
@media(max-width:700px) {
 header #theme-toggle { right:44px; }
 header .user-panel { right:92px;max-width:105px; }
 main > header > div:first-child { max-width:calc(100% - 205px); }
 :root[data-theme="dark"] .account-selector > #refresh { background:#1b232f;color:#a7bcff;border-color:#394453; }
 :root[data-theme="dark"] .history-card > .filters > #clear-filters { background:#1b232f;color:#becadb; }
}
/* All seven indicators on a single row, with accessible drill-down buttons. */
.dashboard-card-row { display:grid;grid-template-columns:repeat(7,minmax(150px,1fr));gap:10px;overflow-x:auto;margin:16px 0 20px;padding-bottom:4px; }
.dashboard-card-row .period-cards,.dashboard-card-row .status-cards { display:contents; }
.dashboard-card-row .metric-card { display:block;text-align:left;font:inherit;padding:16px 14px;min-height:140px;transition:border-color .15s; }
.dashboard-card-row .metric-card strong { font-size:20px;margin:12px 0 8px;text-align:left; }
.dashboard-card-row .metric-card small { font-size:10px; }
.dashboard-card-row .metric-card:hover,.dashboard-card-row .metric-card[aria-expanded="true"] { border-color:var(--blue); }
.dashboard-card-row .metric-card:focus-visible { outline:2px solid var(--blue);outline-offset:-3px; }
.dashboard-details { margin-bottom:20px;overflow:hidden; }
.details-heading { display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:18px; }
.details-heading h3 { margin:0 0 6px;font-size:16px; }
.details-scroll { overflow:auto;max-height:480px; }
.details-scroll th { position:sticky;top:0;z-index:1; }
.details-scroll td { font-family:inherit;font-size:12px;max-width:280px;white-space:normal;overflow-wrap:anywhere; }
.details-scroll td:nth-child(7) { font-family:monospace;min-width:180px; }
.details-scroll td small { display:block;margin-top:5px;color:var(--muted); }
@media(max-width:700px) {
 .dashboard-card-row { grid-template-columns:repeat(7,170px);gap:8px; }
 .dashboard-card-row .metric-card { padding:14px;min-height:130px; }
 .details-heading { padding:14px; }.details-heading h3 { font-size:14px; }
 .details-scroll table { min-width:940px; }
}
/* White login screen, independent of the panel theme. */
.login-screen { background:#fff; }
.login-card { background:#fff;color:#24324b;border-color:#d5e2ee;box-shadow:0 24px 64px #243b531a; }
.login-subtitle { color:#71829a; }
#login-form label { color:#304761; }
#login-form input { background:#f8fbff;border-color:#ccdbeb;color:#24324b;color-scheme:light; }
#login-form input::placeholder { color:#9aa5b7; }
.login-card > small { color:#8492a4; }
.login-error { color:#a23c30; }
/* Black central login card on the white page. */
.login-card { background:#000;color:#f1f5f3;border-color:#242424;box-shadow:0 24px 64px #243b5320; }
.login-card .login-subtitle { color:#a0aaa5; }
#login-form label { color:#d0d6d3; }
#login-form input { background:#141414;border-color:#333;color:#f4f6f5;color-scheme:dark; }
#login-form input::placeholder { color:#87928c; }
.login-card > small { color:#929c97; }
.login-card .login-error { color:#ff9a91; }
/* Light gray page surrounding the black login card. */
.login-screen { background:#e2e5e9; }
/* Reports access belongs to the phone header, below the user controls. */
@media(max-width:700px) {
 main > header { min-height:82px; }
 header .header-actions > .reports-only { position:absolute;right:0;top:46px;display:inline-flex;align-items:center;justify-content:center;width:auto;min-height:28px;margin:0;padding:4px 9px;gap:5px;font-size:11px;line-height:1.2;color:var(--blue);border:1px solid var(--border);background:transparent;border-radius:6px; }
 header .header-actions > .reports-only.active { background:#edf1ff; }
 :root[data-theme="dark"] header .header-actions > .reports-only.active { background:#26344d; }
}
/* Phone reports: compact swipeable cards and charts fitted to the screen. */
@media(max-width:700px) {
 #reports-view { padding-top:12px;overflow-x:hidden; }
 .dashboard-toolbar { padding:10px;gap:8px; }
 #dashboard-notice { font-size:10px;line-height:1.5;margin:10px 0; }
 .dashboard-card-row { grid-template-columns:repeat(7, minmax(148px,42vw));gap:8px;margin:12px 0 16px;scroll-snap-type:x proximity;scroll-padding:2px;overscroll-behavior-x:contain; }
 .dashboard-card-row .metric-card { min-height:118px;padding:12px;scroll-snap-align:start; }
 .dashboard-card-row .metric-card > span { display:block;min-height:26px;font-size:10px;line-height:1.3; }
 .dashboard-card-row .metric-card strong { font-size:18px;letter-spacing:-.5px;margin:8px 0 6px;white-space:nowrap; }
 .dashboard-card-row .metric-card small { font-size:9px;line-height:1.45; }
 .dashboard-card-row::-webkit-scrollbar { height:4px; }.dashboard-card-row::-webkit-scrollbar-thumb { background:#a7b2c1;border-radius:4px; }
 .dashboard-charts { display:flex;flex-direction:column;gap:12px; }
 .dashboard-chart { padding:14px 10px;border-radius:10px; }
 .dashboard-chart h3 { font-size:14px; }.dashboard-chart > p { font-size:10px;line-height:1.5; }
 .chart-legend { gap:8px 12px;margin:12px 0 8px;font-size:10px; }
 #dashboard-bars { overflow:hidden; }#dashboard-bars svg { min-width:0;width:100%; }
 #dashboard-distribution svg { max-width:260px;margin:0 auto; }
 .distribution-legend { display:grid;grid-template-columns:1fr;gap:5px; }
 .distribution-legend p { margin:0;padding:8px 10px;background:#f3f6fb;border-radius:6px;font-size:11px; }
 .dashboard-footnote { font-size:10px;line-height:1.5; }
 .details-heading { padding:12px;gap:8px; }.details-heading h3 { font-size:13px; }.details-heading p { font-size:10px; }
 .details-heading > button { min-height:36px;padding:6px 10px;font-size:11px; }
 .details-scroll { padding:8px;max-height:60dvh; }
 .details-scroll table,.details-scroll tbody { display:block;min-width:0;width:100%; }
 .details-scroll thead { display:none; }
 .details-scroll tbody tr { display:grid;grid-template-columns:1fr 1fr;gap:0 12px;border:1px solid var(--border);border-radius:8px;padding:8px 10px;margin-bottom:8px; }
 .details-scroll td { display:block;min-width:0!important;max-width:none;border:0;padding:8px 0;font-size:11px; }
 .details-scroll td::before { content:attr(data-label);display:block;font-size:9px;color:var(--muted);margin-bottom:4px; }
 .details-scroll td:nth-child(4),.details-scroll td:nth-child(6),.details-scroll td:nth-child(7) { grid-column:1/-1; }
 .details-scroll td[colspan] { grid-column:1/-1; }.details-scroll td[colspan]::before { display:none; }
 .details-scroll td:nth-child(2) { font-weight:600; }
 :root[data-theme="dark"] .distribution-legend p { background:#242d39; }
}
/* Analytical receipts follow the same mobile card hierarchy as Pix validation. */
.details-scroll .details-toggle-cell { display:none; }
@media(max-width:700px) {
 .details-scroll tbody tr { grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:0 10px;background:white; }
 .details-scroll td:nth-child(1) { grid-column:1;grid-row:1; }
 .details-scroll td:nth-child(2) { grid-column:2;grid-row:1;text-align:right;font-size:18px; }
 .details-scroll td:nth-child(4) { grid-column:1;grid-row:2;border-top:1px solid var(--border);font-weight:600; }
 .details-scroll td:nth-child(5) { grid-column:2;grid-row:2;text-align:right;border-top:1px solid var(--border); }
 .details-scroll td:nth-child(3) { grid-column:1/-1;grid-row:3; }
 .details-scroll tr[data-refunded="false"] td:nth-child(3) { display:none; }
 .details-scroll td:nth-child(6),.details-scroll td:nth-child(7) { display:none; }
 .details-scroll tr.details-expanded td:nth-child(6),.details-scroll tr.details-expanded td:nth-child(7) { display:block;grid-column:1/-1;border-top:1px solid var(--border); }
 .details-scroll .details-toggle-cell { display:block;grid-column:1/-1; }
 .details-toggle-cell > button { width:100%;min-height:36px;font-size:11px; }
 :root[data-theme="dark"] .details-scroll tbody tr { background:#191e26; }
}
/* Keep a visible route back from reports on phones. */
.mobile-back-validation { display:none; }
@media(max-width:700px) {
 main:has(#reports-view:not([hidden])) .mobile-back-validation { display:inline-flex;position:absolute;right:0;top:46px;min-height:30px;padding:5px 10px;font-size:11px; }
 main:has(#reports-view:not([hidden])) .header-actions > .reports-only { display:none!important; }
}
/* Three cards per row; reports use vertical scrolling only. */
.dashboard-card-row { grid-template-columns:repeat(3,minmax(0,1fr));overflow:visible;scroll-snap-type:none; }
.dashboard-card-row .metric-card { min-width:0;scroll-snap-align:none; }
.dashboard-card-row .metric-card strong { white-space:normal;overflow-wrap:anywhere; }
#reports-view { overflow-x:hidden; }
@media(max-width:700px) {
 .dashboard-card-row { grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;overflow:visible;padding-bottom:0; }
 .dashboard-card-row .metric-card { min-height:114px;padding:9px 7px; }
 .dashboard-card-row .metric-card > span { min-height:30px;font-size:9px;line-height:1.35;overflow-wrap:anywhere; }
 .dashboard-card-row .metric-card strong { font-size:clamp(11px,3.2vw,16px);letter-spacing:-.4px;margin:7px 0 5px;white-space:normal; }
 .dashboard-card-row .metric-card small { font-size:8px;line-height:1.4;overflow-wrap:anywhere; }
 .details-scroll { max-height:none;overflow:visible; }
}
