﻿/* Kalista — financial dashboard components */
body.has-mobile-nav { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
.content { max-width: var(--content-wide); }
.avatar {
  background: linear-gradient(135deg, var(--kalista), var(--kalista-fuchsia));
}
.upload-bar {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-panel);
  border-top: 1px solid var(--border); padding: 0.65rem 2rem;
  display: flex; align-items: center; gap: 1rem; z-index: 100;
  backdrop-filter: blur(8px);
}
    /* â”€â”€ Selectors â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
    .selectors { margin-bottom: 1.25rem; display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
    .sel-group { display: flex; align-items: center; gap: 0.4rem; }
    .sel-group label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
    .sel-group select {
      background: var(--surface); border: 1px solid var(--border); color: var(--text);
      padding: 0.45rem 0.9rem; border-radius: 8px; font-size: 0.85rem; cursor: pointer;
      font-family: inherit;
    }
    .sel-group select:focus { outline: none; border-color: var(--accent); }
    .sel-badge {
      display: inline-flex; align-items: center; gap: 0.35rem; margin-left: auto;
      background: var(--surface-2); border: 1px solid var(--border); padding: 0.25rem 0.65rem;
      border-radius: 6px; font-size: 0.7rem; color: var(--text-muted);
    }
    .sel-badge .dot { width: 5px; height: 5px; border-radius: 50%; }
    .dot-ok { background: var(--green); } .dot-warn { background: var(--yellow); } .dot-danger { background: var(--red); }

    /* â”€â”€ LAYER 1: Behavioral Insights â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
    .insights-strip {
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem;
      margin-bottom: 1.25rem;
    }
    @media (max-width: 900px) { .insights-strip { grid-template-columns: 1fr; } }
    .insight-card {
      background: var(--bg-surface); border: 1px solid var(--border-strong);
      box-shadow: var(--shadow-surface);
      border-radius: var(--radius); padding: 1.1rem 1.2rem;
      display: flex; flex-direction: column; gap: 0.6rem;
      border-top: 2px solid transparent;
    }
    .insight-card.sev-critical { border-top-color: var(--red); background: linear-gradient(180deg, rgba(248,113,113,0.04) 0%, var(--surface) 40%); }
    .insight-card.sev-warning  { border-top-color: var(--yellow); background: linear-gradient(180deg, rgba(251,191,36,0.04) 0%, var(--surface) 40%); }
    .insight-card.sev-info     { border-top-color: var(--blue); background: linear-gradient(180deg, rgba(96,165,250,0.03) 0%, var(--surface) 40%); }
    .insight-card.sev-positive { border-top-color: var(--green); background: linear-gradient(180deg, rgba(52,211,153,0.04) 0%, var(--surface) 40%); }
    .insight-label { display: flex; align-items: center; gap: 0.4rem; }
    .insight-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
    .sev-critical .insight-dot { background: var(--red); box-shadow: 0 0 8px rgba(248,113,113,0.5); }
    .sev-warning  .insight-dot { background: var(--yellow); }
    .sev-info     .insight-dot { background: var(--blue); }
    .sev-positive .insight-dot { background: var(--green); box-shadow: 0 0 8px rgba(52,211,153,0.4); }
    .insight-tag {
      font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    }
    .sev-critical .insight-tag { color: var(--red); }
    .sev-warning  .insight-tag { color: var(--yellow); }
    .sev-info     .insight-tag { color: var(--blue); }
    .sev-positive .insight-tag { color: var(--green); }
    .insight-title { font-size: 0.88rem; font-weight: 600; line-height: 1.3; }
    .insight-body { font-size: 0.8rem; line-height: 1.6; color: var(--text-secondary); }

    /* â”€â”€ LAYER 2: KPI Strip â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
    .kpi-strip {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
      gap: 0.85rem; margin-bottom: 1.25rem;
    }
    .kpi {
      background: var(--bg-surface); border: 1px solid var(--border-strong);
      box-shadow: var(--shadow-surface);
      border-radius: var(--radius); padding: 1.1rem 1.15rem;
    }
    .kpi .kpi-label {
      font-size: 0.62rem; color: var(--text-muted); text-transform: uppercase;
      letter-spacing: 1.2px; font-weight: 600; margin-bottom: 0.45rem;
    }
    .kpi .kpi-value { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
    .kpi .kpi-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.25rem; }
    .kpi.kpi-ok .kpi-value { color: var(--green); }
    .kpi.kpi-warn .kpi-value { color: var(--yellow); }
    .kpi.kpi-danger .kpi-value { color: var(--red); }
    /* Debt load bar */
    .debt-bar-track {
      height: 4px; background: var(--surface-3); border-radius: 2px; margin-top: 0.6rem; overflow: hidden;
    }
    .debt-bar-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease; }
    .debt-bar-fill.bar-ok { background: var(--green); }
    .debt-bar-fill.bar-warn { background: var(--yellow); }
    .debt-bar-fill.bar-high { background: var(--red); }

    /* â”€â”€ LAYER 3: Two-column panels â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
    .panels { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
    @media (max-width: 960px) { .panels { grid-template-columns: 1fr; } }
    .panel {
      background: var(--bg-surface); border: 1px solid var(--border-strong);
      box-shadow: var(--shadow-surface);
      border-radius: var(--radius); padding: 1.2rem;
    }
    .panel-title {
      font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px;
      color: var(--text-muted); margin-bottom: 1rem;
    }
    .chart-wrap { position: relative; height: 280px; }

    /* Budget bars */
    .budget-list { display: flex; flex-direction: column; gap: 0.75rem; }
    .budget-row { display: flex; flex-direction: column; gap: 0.3rem; }
    .budget-header { display: flex; justify-content: space-between; align-items: baseline; }
    .budget-cat { font-size: 0.8rem; font-weight: 500; }
    .budget-nums { font-size: 0.72rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
    .budget-track { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
    .budget-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
    .budget-fill.b-ok { background: var(--accent); }
    .budget-fill.b-warn { background: var(--yellow); }
    .budget-fill.b-over { background: var(--red); }
    .budget-pct { font-size: 0.65rem; text-align: right; margin-top: 0.1rem; }
    .budget-pct.p-ok { color: var(--text-muted); } .budget-pct.p-warn { color: var(--yellow); } .budget-pct.p-over { color: var(--red); }

    /* Info rows */
    .info-rows .row {
      display: flex; justify-content: space-between; padding: 0.55rem 0;
      border-bottom: 1px solid var(--border); font-size: 0.82rem;
    }
    .info-rows .row:last-child { border-bottom: none; }
    .info-rows .row .key { color: var(--text-muted); }

    /* â”€â”€ LAYER 4: Transactions table â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
    .tx-section {
      background: var(--bg-surface); border: 1px solid var(--border-strong);
      box-shadow: var(--shadow-surface);
      border-radius: var(--radius); padding: 1.2rem;
    }
    .tx-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.85rem; }
    .tx-header h2 { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-muted); }
    .tx-filters { display: flex; gap: 0.4rem; flex-wrap: wrap; }
    .tx-filters button {
      background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
      padding: 0.3rem 0.75rem; border-radius: 20px; font-size: 0.72rem; cursor: pointer;
      transition: all 0.15s; font-family: inherit; font-weight: 500;
    }
    .tx-filters button.active, .tx-filters button:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
    .tx-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
    .tx-table th {
      text-align: left; color: var(--text-muted); font-weight: 600; padding: 0.55rem 0.45rem;
      border-bottom: 1px solid var(--border); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.8px;
    }
    .tx-table td { padding: 0.55rem 0.45rem; border-bottom: 1px solid var(--border); }
    .tx-table tr:hover { background: var(--surface-2); }
    .tx-table .monto { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
    .badge {
      display: inline-block; padding: 0.12rem 0.5rem; border-radius: 10px;
      font-size: 0.65rem; font-weight: 600; letter-spacing: 0.3px;
    }
    .badge-compra  { background: var(--accent-dim); color: var(--accent-light); }
    .badge-pago    { background: var(--green-dim); color: var(--green); }
    .badge-interes { background: var(--red-dim); color: var(--red); }
    .badge-seguro  { background: var(--yellow-dim); color: var(--yellow); }
    .badge-cargo   { background: rgba(107,113,148,0.15); color: var(--text-muted); }
    .badge-cat { font-weight: 600; border: none; }
    .badge-card-type {
      font-size: 0.58rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
      padding: 0.15rem 0.5rem; border-radius: 6px; cursor: pointer;
      transition: opacity 0.15s;
    }
    .badge-card-type:hover { opacity: 0.8; }
    .badge-credito { background: var(--blue-dim); color: var(--blue); }
    .badge-debito { background: var(--green-dim); color: var(--green); }
    /* Fixed/Variable dot */
    .type-dot {
      display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 0.2rem;
      vertical-align: middle;
    }
    .type-fijo     { background: var(--blue); }
    .type-variable { background: var(--accent-light); }

    /* â”€â”€ Upload bar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
    .upload-bar {
      position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface);
      border-top: 1px solid var(--border); padding: 0.65rem 2rem;
      display: flex; align-items: center; gap: 1rem; z-index: 100;
    }
    .upload-bar input[type="file"] { flex: 1; font-size: 0.8rem; color: var(--text-muted); font-family: inherit; }
    .upload-bar button {
      background: var(--accent); color: #fff; border: none; padding: 0.45rem 1.1rem;
      border-radius: 8px; font-size: 0.8rem; cursor: pointer; font-weight: 600; font-family: inherit;
    }
    .upload-bar button:hover { background: var(--accent-light); }
    .upload-bar button:disabled { opacity: 0.5; cursor: not-allowed; }
    .upload-bar .status { font-size: 0.75rem; color: var(--text-muted); }
    /* â”€â”€ Overview â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
    .overview-controls {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.75rem;
    }
    .overview-title {
      font-size: 0.85rem; font-weight: 600; color: var(--text-secondary);
    }
    .view-toggle {
      display: flex; background: var(--bg-surface); border: 1px solid var(--border-strong);
      box-shadow: var(--shadow-surface);
      border-radius: 10px; overflow: hidden;
    }
    .view-toggle button {
      background: none; border: none; color: var(--text-muted); font-family: inherit;
      font-size: 0.78rem; font-weight: 500; padding: 0.45rem 1rem; cursor: pointer;
      transition: all 0.15s;
    }
    .view-toggle button:hover { color: var(--text); }
    .view-toggle button.active {
      background: var(--accent); color: #fff; font-weight: 600;
    }
    .card-selector {
      display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.25rem;
    }
    .card-selector label {
      font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase;
      letter-spacing: 1px; font-weight: 600;
    }
    .card-selector select {
      background: var(--surface); border: 1px solid var(--border); color: var(--text);
      padding: 0.45rem 0.9rem; border-radius: 8px; font-size: 0.85rem; cursor: pointer;
      font-family: inherit;
    }
    .ts-panel {
      background: var(--bg-surface); border: 1px solid var(--border-strong);
      box-shadow: var(--shadow-surface);
      border-radius: 16px; padding: 1.5rem; margin-bottom: 1rem;
    }
    .ts-panel-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 1rem;
    }
    .ts-panel-title {
      font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem;
    }
    .ts-panel-title .marca-badge {
      font-size: 0.6rem; background: var(--accent-dim); color: var(--accent-light);
      padding: 0.15rem 0.5rem; border-radius: 6px; font-weight: 700;
    }
    .ts-section-header {
      font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
      text-transform: uppercase; letter-spacing: 1.5px;
      padding: 0.75rem 0.25rem 0.35rem; margin-top: 0.5rem;
      border-bottom: 1px solid var(--border); margin-bottom: 0.75rem;
    }
    .ts-panel-stat {
      font-size: 0.75rem; color: var(--text-muted);
      font-variant-numeric: tabular-nums;
    }
    .ts-legend {
      display: flex; flex-wrap: wrap; gap: 0.5rem 1rem;
      margin-bottom: 0.75rem; padding: 0 0.25rem;
    }
    .ts-legend-item {
      display: flex; align-items: center; gap: 0.35rem;
      font-size: 0.7rem; color: var(--text-muted); white-space: nowrap;
      cursor: pointer; padding: 0.2rem 0.45rem; border-radius: 6px;
      transition: opacity 0.2s, background 0.15s;
      user-select: none;
    }
    .ts-legend-item:hover { background: rgba(255,255,255,0.04); }
    .ts-legend-item.off { opacity: 0.3; }
    .ts-legend-item.off .ts-legend-dot { background: var(--text-muted) !important; }
    .ts-legend-dot {
      width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
      transition: background 0.2s;
    }
    .ts-chart-wrap { position: relative; height: 280px; }
    .ts-panel + .ts-panel { margin-top: 0.85rem; }

    .empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
    .empty-state h2 { font-size: 1.4rem; margin-bottom: 0.75rem; color: var(--text); font-weight: 600; }
    .empty-state p { max-width: 480px; margin: 0 auto; line-height: 1.6; }
    /* â”€â”€ Confirm Modal â”€â”€ */
    .modal-overlay {
      position: fixed; inset: 0; z-index: 1000;
      background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
      display: flex; align-items: center; justify-content: center;
      opacity: 0; transition: opacity 0.2s; pointer-events: none;
    }
    .modal-overlay.show { opacity: 1; pointer-events: auto; }
    .modal-box {
      background: var(--surface-2); border: 1px solid var(--border-light);
      border-radius: 16px; padding: 2rem 2.25rem; max-width: 380px; width: 90%;
      text-align: center; transform: scale(0.92); transition: transform 0.2s;
    }
    .modal-overlay.show .modal-box { transform: scale(1); }
    .modal-icon { font-size: 2rem; margin-bottom: 0.75rem; }
    .modal-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.35rem; }
    .modal-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 1.25rem; }
    .modal-actions { display: flex; gap: 0.75rem; justify-content: center; }
    .modal-btn {
      font-family: inherit; font-size: 0.8rem; font-weight: 600;
      padding: 0.55rem 1.5rem; border-radius: 10px; border: none; cursor: pointer;
      transition: all 0.15s;
    }
    .modal-btn-cancel { background: var(--surface-3); color: var(--text-muted); }
    .modal-btn-cancel:hover { background: var(--border); color: var(--text); }
    .modal-btn-confirm { background: var(--accent); color: #fff; }
    .modal-btn-confirm:hover { opacity: 0.85; }

    /* â”€â”€ Settings button â”€â”€ */
    .settings-btn {
      background: none; border: 1px solid var(--border); color: var(--text-muted);
      width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: all 0.15s; font-size: 1rem;
    }
    .settings-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-light); }

    /* â”€â”€ TX detail modal (click en time-series) â”€â”€ */
    .tx-detail-box {
      background: var(--surface); border: 1px solid var(--border-light);
      border-radius: 16px; box-shadow: 0 24px 60px -20px rgba(0,0,0,0.7);
      width: min(640px, 92vw); max-height: 86vh;
      display: flex; flex-direction: column; overflow: hidden;
      transform: scale(0.94); transition: transform 0.2s;
      position: relative;
    }
    .modal-overlay.show .tx-detail-box { transform: scale(1); }
    /* Close button inside tx-detail-box: sit above the header without clipping */
    .tx-detail-box > .settings-close {
      position: absolute; top: 0.85rem; right: 0.85rem; z-index: 10;
    }
    .tx-detail-header {
      padding: 1.5rem 3rem 1.1rem 1.75rem; border-bottom: 1px solid var(--border);
      background: linear-gradient(180deg, rgba(168,85,247,0.04) 0%, transparent 100%);
      display: flex; align-items: flex-start; gap: 0.85rem;
    }
    .tx-detail-cat-dot {
      width: 12px; height: 12px; border-radius: 50%; margin-top: 0.5rem; flex-shrink: 0;
    }
    .tx-detail-title-block { flex: 1; min-width: 0; }
    .tx-detail-eyebrow {
      font-size: 0.66rem; font-weight: 600; letter-spacing: 1.6px;
      text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.25rem;
    }
    .tx-detail-title {
      font-size: 1.05rem; font-weight: 700; letter-spacing: -0.015em;
      margin-bottom: 0.15rem; line-height: 1.3;
    }
    .tx-detail-subtitle {
      font-size: 0.78rem; color: var(--text-secondary); line-height: 1.4;
    }
    .tx-detail-total {
      text-align: right; padding-left: 1rem; border-left: 1px solid var(--border);
    }
    .tx-detail-total-label {
      font-size: 0.6rem; color: var(--text-muted); letter-spacing: 1.2px;
      text-transform: uppercase; font-weight: 600;
    }
    .tx-detail-total-value {
      font-size: 1.15rem; font-weight: 700; color: var(--text);
      margin-top: 0.2rem; font-variant-numeric: tabular-nums;
    }
    .tx-detail-body {
      padding: 0.8rem 0.6rem 1.25rem; overflow-y: auto; flex: 1;
    }
    .tx-row {
      display: grid; grid-template-columns: 1fr auto;
      gap: 0.4rem 1rem; padding: 0.85rem 1.15rem;
      border-radius: 10px; transition: background 0.12s;
      border: 1px solid transparent;
    }
    .tx-row + .tx-row { margin-top: 0.35rem; }
    .tx-row:hover { background: var(--surface-2); border-color: var(--border); }
    .tx-row-desc {
      font-size: 0.86rem; font-weight: 500; color: var(--text);
      grid-column: 1; line-height: 1.35;
      word-break: break-word;
    }
    .tx-row-amount {
      font-size: 0.92rem; font-weight: 700; text-align: right;
      grid-column: 2; font-variant-numeric: tabular-nums; white-space: nowrap;
      color: var(--text);
    }
    .tx-row-amount.pago { color: var(--green); }
    .tx-row-amount.compra { color: var(--text); }
    .tx-row-amount.interes, .tx-row-amount.cargo, .tx-row-amount.seguro { color: var(--red); }
    .tx-row-meta {
      grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.45rem;
      font-size: 0.7rem; color: var(--text-muted); align-items: center;
      margin-top: 0.15rem;
    }
    .tx-meta-chip {
      display: inline-flex; align-items: center; gap: 0.25rem;
      background: var(--surface-2); border: 1px solid var(--border);
      padding: 0.15rem 0.45rem; border-radius: 5px;
      font-size: 0.66rem; color: var(--text-secondary); white-space: nowrap;
    }
    .tx-meta-chip-cat { border-color: currentColor; opacity: 0.9; }
    .tx-detail-empty {
      padding: 3rem 1.5rem; text-align: center; color: var(--text-muted);
    }

    @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

    /* â”€â”€ Toast notifications â”€â”€ */
    .toast-stack {
      position: fixed; right: 1.25rem; bottom: 1.25rem;
      display: flex; flex-direction: column; gap: 0.6rem;
      z-index: 9999; pointer-events: none;
      max-width: min(420px, calc(100vw - 2.5rem));
    }
    .toast {
      background: var(--surface); border: 1px solid var(--border);
      border-left: 3px solid var(--accent);
      color: var(--text); padding: 0.85rem 1rem;
      border-radius: 9px; font-size: 0.85rem; line-height: 1.45;
      box-shadow: 0 10px 32px -10px rgba(0,0,0,0.6), 0 2px 6px -2px rgba(0,0,0,0.3);
      pointer-events: auto; opacity: 0; transform: translateY(8px);
      transition: opacity 0.18s ease, transform 0.18s ease;
      display: flex; align-items: flex-start; gap: 0.65rem;
    }
    .toast.show { opacity: 1; transform: translateY(0); }
    .toast-success { border-left-color: var(--green); }
    .toast-error   { border-left-color: var(--red); }
    .toast-info    { border-left-color: var(--blue, #60a5fa); }
    .toast-icon { flex-shrink: 0; width: 18px; height: 18px; }
    .toast-icon svg { width: 18px; height: 18px; }
    .toast-success .toast-icon { color: var(--green); }
    .toast-error   .toast-icon { color: var(--red); }
    .toast-info    .toast-icon { color: var(--blue, #60a5fa); }
    .toast-body { flex: 1; }
    .toast-title { font-weight: 600; margin-bottom: 0.15rem; }
    .toast-sub { color: var(--text-muted); font-size: 0.78rem; }

    /* â”€â”€ Empty-state CTA for first-time sync â”€â”€ */
    .empty-cta {
      max-width: 480px; margin: 4rem auto 0; padding: 2.25rem 2rem;
      background: linear-gradient(180deg, rgba(168,85,247,0.05) 0%, var(--surface) 80%);
      border: 1px solid var(--border); border-radius: 14px; text-align: center;
    }
    .empty-cta h2 { font-size: 1.35rem; margin-bottom: 1.1rem; letter-spacing: -0.015em; }

    /* Orange/red sync notice â€” replaces old CTA buttons */
    .sync-notice {
      display: flex; align-items: flex-start; gap: 0.9rem;
      background: rgba(234, 112, 30, 0.12);
      border: 1.5px solid rgba(234, 112, 30, 0.55);
      border-radius: 10px; padding: 0.95rem 1.1rem;
      text-align: left; color: var(--text);
      font-size: 0.88rem; line-height: 1.55;
    }
    .sync-notice--red {
      background: rgba(220, 60, 60, 0.11);
      border-color: rgba(220, 60, 60, 0.5);
    }
    .sync-notice-bang {
      flex-shrink: 0;
      width: 22px; height: 22px; border-radius: 50%;
      background: #ea701e; color: #fff;
      font-weight: 800; font-size: 0.8rem;
      display: flex; align-items: center; justify-content: center;
      margin-top: 0.05rem;
    }
    .sync-notice--red .sync-notice-bang { background: #dc3c3c; }
    .sync-notice-gear {
      display: inline-block;
      font-size: 0.75em; line-height: 1;
      vertical-align: middle; margin: 0 1px;
      opacity: 0.9;
    }

    /* â”€â”€ Sync button spinner â”€â”€ */
    @keyframes _spin { to { transform: rotate(360deg); } }
    @keyframes _slide-bar {
      0%   { left: -30%; width: 30%; }
      50%  { left: 20%;  width: 50%; }
      100% { left: 100%; width: 30%; }
    }
    .sync-btn-spinner {
      display: inline-block;
      width: 13px; height: 13px;
      border: 2px solid rgba(255,255,255,0.35);
      border-top-color: #fff;
      border-radius: 50%;
      animation: _spin 0.7s linear infinite;
      vertical-align: middle; margin-right: 6px;
      flex-shrink: 0;
    }
    /* â”€â”€ Inline sync progress / result area â”€â”€ */
    .sync-prog {
      margin-top: 0.65rem;
      border-radius: 8px;
      font-size: 0.78rem;
      overflow: hidden;
    }
    .sync-prog-loading {
      background: rgba(126,105,255,0.10);
      border: 1px solid rgba(126,105,255,0.25);
      padding: 0.7rem 0.9rem;
    }
    .sync-prog-bar-wrap {
      height: 3px; background: rgba(126,105,255,0.15);
      border-radius: 2px; margin-bottom: 0.55rem; overflow: hidden;
      position: relative;
    }
    .sync-prog-bar {
      position: absolute; top: 0; height: 100%; background: var(--accent);
      border-radius: 2px;
      animation: _slide-bar 1.4s ease-in-out infinite;
    }
    .sync-prog-label {
      color: var(--text); font-weight: 500; display: flex; align-items: center; gap: 0.4rem;
    }
    .sync-prog-sub { color: var(--text-muted); margin-top: 0.25rem; }
    .sync-prog-ok {
      background: rgba(34,197,94,0.08);
      border: 1px solid rgba(34,197,94,0.3);
      padding: 0.65rem 0.9rem; display: flex; align-items: flex-start; gap: 0.6rem;
    }
    .sync-prog-ok-icon {
      width: 18px; height: 18px; border-radius: 50%;
      background: #22c55e; color: #fff;
      display: flex; align-items: center; justify-content: center;
      font-size: 0.65rem; font-weight: 700; flex-shrink: 0; margin-top: 1px;
    }
    .sync-prog-ok-title { color: #22c55e; font-weight: 600; }
    .sync-prog-ok-stats { color: var(--text-muted); margin-top: 0.2rem; font-size: 0.72rem; }
    .sync-prog-err {
      background: rgba(220,60,60,0.09);
      border: 1px solid rgba(220,60,60,0.35);
      padding: 0.65rem 0.9rem; display: flex; align-items: flex-start; gap: 0.6rem;
    }
    .sync-prog-err-icon {
      width: 18px; height: 18px; border-radius: 50%;
      background: #dc3c3c; color: #fff;
      display: flex; align-items: center; justify-content: center;
      font-size: 0.7rem; font-weight: 700; flex-shrink: 0; margin-top: 1px;
    }
    .sync-prog-err-title { color: #dc3c3c; font-weight: 600; }
    .sync-prog-err-detail { color: var(--text-muted); margin-top: 0.2rem; font-size: 0.72rem; word-break: break-word; }

    /* â”€â”€ Products Card Gallery â”€â”€ */
    .products-grid { display: flex; flex-direction: column; gap: 0.75rem; }
    .product-row {
      display: flex; align-items: center; gap: 1rem;
      background: var(--surface); border: 1px solid var(--border-light);
      border-radius: 12px; padding: 0.75rem 1rem;
      transition: border-color 0.2s;
    }
    .product-row:hover { border-color: var(--accent-dim); }
    .product-card-wrap { perspective: 600px; flex-shrink: 0; }
    .product-card {
      position: relative;
      width: 140px; height: 88px;
      border-radius: 10px;
      padding: 0.5rem 0.6rem;
      display: flex; flex-direction: column; justify-content: space-between;
      overflow: hidden;
      transform-style: preserve-3d;
      transition: transform 0.2s ease-out, box-shadow 0.25s ease;
      box-shadow: 0 3px 12px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
      will-change: transform; cursor: default;
    }
    .product-card::before {
      content: ''; position: absolute; inset: 0;
      background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
      pointer-events: none; border-radius: inherit;
    }
    .product-card::after {
      content: ''; position: absolute; inset: 0;
      background: radial-gradient(circle at var(--mouse-x,50%) var(--mouse-y,50%),
        rgba(255,255,255,0.18) 0%, transparent 60%);
      opacity: 0; transition: opacity 0.3s;
      pointer-events: none; border-radius: inherit; mix-blend-mode: overlay;
    }
    .product-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
    .product-card:hover::after { opacity: 1; }
    .product-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
    .product-card-bank { font-size: 0.5rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,0.7); }
    .product-card-brand { font-size: 0.5rem; font-weight: 700; color: rgba(255,255,255,0.85); text-transform: uppercase; letter-spacing: 0.5px; }
    .product-card-chip { width: 20px; height: 14px; border-radius: 3px; background: linear-gradient(135deg,#d4a853 0%,#f5d98a 40%,#b8860b 100%); margin: 0.15rem 0; }
    .product-card-number { font-size: 0.65rem; font-weight: 600; letter-spacing: 1.5px; color: rgba(255,255,255,0.92); font-family: 'SF Mono','Cascadia Code',monospace; }
    .product-card-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
    .product-card-name { font-size: 0.45rem; font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase; color: rgba(255,255,255,0.6); }
    .product-card-type { font-size: 0.4rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,0.45); }
    @keyframes _shimmer { 0% { background-position: -200% center; } 100% { background-position: 200% center; } }
    .product-card-shimmer {
      position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
      background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,0.06) 50%, transparent 70%);
      background-size: 200% 100%; animation: _shimmer 3s ease-in-out infinite;
    }
    .product-meta { flex: 1; min-width: 0; }
    .product-meta-title { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .product-meta-sub { font-size: 0.7rem; color: var(--text-muted); line-height: 1.4; }
    .product-meta-badge { display: inline-block; font-size: 0.6rem; font-weight: 600; padding: 0.1rem 0.4rem; border-radius: 4px; letter-spacing: 0.5px; text-transform: uppercase; }
    .product-meta-badge-credito { background: rgba(249,115,22,0.15); color: #f97316; }
    .product-meta-badge-debito { background: rgba(6,182,212,0.15); color: #06b6d4; }
    .product-actions { display: flex; flex-direction: column; gap: 0.4rem; flex-shrink: 0; }
    .product-actions button {
      padding: 0.35rem 0.75rem; border-radius: 6px; font-size: 0.68rem;
      font-weight: 600; cursor: pointer; font-family: inherit; border: 1px solid var(--border);
      background: var(--surface-3); color: var(--text); transition: all 0.15s; white-space: nowrap;
    }
    .product-actions button:hover { border-color: var(--accent-dim); color: var(--accent-light); }
    .product-btn-disable { color: var(--red) !important; border-color: rgba(220,60,60,0.3) !important; }
    .product-btn-disable:hover { background: rgba(220,60,60,0.1) !important; }
    .product-btn-explore { color: var(--accent-light) !important; border-color: var(--accent-dim) !important; }
    .product-btn-explore:hover { background: rgba(129,140,248,0.1) !important; }
    .product-confirm-overlay {
      position: fixed; inset: 0; z-index: 9999;
      background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
      display: flex; align-items: center; justify-content: center;
    }
    .product-confirm-box {
      background: var(--surface); border: 1px solid var(--border-light);
      border-radius: var(--radius); padding: 1.5rem 2rem; text-align: center;
      max-width: 320px; width: 90%;
    }
    .product-confirm-box h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.5rem; }
    .product-confirm-box p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.25rem; line-height: 1.4; }
    .product-confirm-btns { display: flex; gap: 0.75rem; justify-content: center; }
    .product-confirm-btns button {
      padding: 0.45rem 1.25rem; border-radius: 8px; font-size: 0.8rem;
      font-weight: 600; cursor: pointer; font-family: inherit; border: none; transition: opacity 0.15s;
    }
    .product-confirm-btns button:hover { opacity: 0.85; }
    .product-confirm-yes { background: var(--red); color: #fff; }
    .product-confirm-no { background: var(--surface-3); color: var(--text); border: 1px solid var(--border) !important; }
    .product-explore-overlay {
      position: fixed; inset: 0; z-index: 9998;
      background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
      display: flex; align-items: center; justify-content: center;
      padding: 1rem;
    }
    .product-explore-box {
      background: var(--surface); border: 1px solid var(--border-light);
      border-radius: 14px; width: 95%; max-width: 560px; max-height: 80vh;
      display: flex; flex-direction: column; overflow: hidden;
    }
    .product-explore-header {
      padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-light);
      display: flex; justify-content: space-between; align-items: center;
    }
    .product-explore-header h3 { font-size: 0.95rem; font-weight: 600; margin: 0; }
    .product-explore-close { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; padding: 0.25rem; }
    .product-explore-body { padding: 1.25rem 1.5rem; overflow-y: auto; flex: 1; }
    .product-explore-meta { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; font-size: 0.78rem; margin-bottom: 1rem; }
    .product-explore-meta dt { color: var(--text-muted); font-weight: 500; }
    .product-explore-meta dd { color: var(--text); font-weight: 600; margin: 0; }
    .product-explore-year {
      margin-top: 0.5rem; border: 1px solid var(--border-light); border-radius: 8px; overflow: hidden;
    }
    .product-explore-year-title {
      padding: 0.5rem 0.75rem; font-size: 0.75rem; font-weight: 600;
      cursor: pointer; display: flex; justify-content: space-between; align-items: center;
      background: var(--surface-3); user-select: none;
    }
    .product-explore-year-title:hover { background: var(--surface-2); }
    .product-explore-year-content { display: none; padding: 0.25rem 0.75rem 0.5rem; }
    .product-explore-year.open .product-explore-year-content { display: block; }
    .product-explore-month {
      margin: 0.25rem 0; border-left: 2px solid var(--border-light); padding-left: 0.6rem;
    }
    .product-explore-month-title {
      font-size: 0.7rem; font-weight: 600; color: var(--text-muted);
      cursor: pointer; padding: 0.25rem 0; user-select: none;
    }
    .product-explore-month-title:hover { color: var(--text); }
    .product-explore-month-content { display: none; }
    .product-explore-month.open .product-explore-month-content { display: block; }
    .product-explore-tx {
      font-size: 0.68rem; padding: 0.2rem 0; display: flex; justify-content: space-between;
      border-bottom: 1px solid rgba(255,255,255,0.03);
    }
    .product-explore-tx-desc { color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .product-explore-tx-amount { color: var(--text-muted); font-weight: 600; margin-left: 0.5rem; white-space: nowrap; }

    /* â”€â”€ Settings Modal â”€â”€ */
    .settings-box {
      background: var(--surface); border: 1px solid var(--border-light);
      border-radius: 18px; max-width: 680px; width: 94%; max-height: 85vh;
      display: flex; overflow: hidden;
      transform: scale(0.92); transition: transform 0.2s;
    }
    .modal-overlay.show .settings-box { transform: scale(1); }
    .settings-sidebar {
      width: 170px; min-width: 170px; background: var(--surface-2);
      border-right: 1px solid var(--border); padding: 1.5rem 0;
      display: flex; flex-direction: column; gap: 0.2rem;
    }
    .settings-sidebar-title {
      font-size: 0.62rem; font-weight: 700; color: var(--text-muted);
      text-transform: uppercase; letter-spacing: 1.5px;
      padding: 0 1.25rem; margin-bottom: 0.5rem;
    }
    .stab {
      background: none; border: none; color: var(--text-muted); font-family: inherit;
      font-size: 0.82rem; font-weight: 500; padding: 0.55rem 1.25rem;
      text-align: left; cursor: pointer; transition: all 0.12s;
    }
    .stab:hover { color: var(--text); background: rgba(255,255,255,0.03); }
    .stab.active { color: var(--accent-light); background: var(--accent-dim); font-weight: 600; }

    /* Bottom group of the sidebar: separator + logout, always reachable */
    .settings-sidebar-bottom {
      margin-top: auto; padding: 0.5rem 0;
      border-top: 1px solid var(--border);
      display: flex; flex-direction: column; gap: 0.15rem;
    }
    .stab-logout {
      background: none; border: none; color: var(--red); font-family: inherit;
      font-size: 0.82rem; font-weight: 500; padding: 0.55rem 1.25rem;
      text-align: left; cursor: pointer; transition: all 0.12s;
      display: flex; align-items: center; gap: 0.55rem;
    }
    .stab-logout:hover { background: rgba(248,113,113,0.08); color: #fca5a5; }
    .stab-logout svg { width: 14px; height: 14px; }
    .settings-content {
      flex: 1; padding: 1.75rem; overflow-y: auto;
      scrollbar-width: thin;
      scrollbar-color: color-mix(in srgb, var(--brand-light) 38%, var(--surface-3)) var(--surface);
    }
    .settings-content::-webkit-scrollbar {
      width: 10px;
    }
    .settings-content::-webkit-scrollbar-track {
      background: var(--surface);
      border-left: 1px solid var(--border-subtle);
    }
    .settings-content::-webkit-scrollbar-thumb {
      background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--brand-light) 32%, var(--surface-3)),
        color-mix(in srgb, var(--brand) 26%, var(--surface-3))
      );
      border: 2px solid var(--surface);
      border-radius: 100px;
      box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-border) 55%, transparent);
    }
    .settings-content::-webkit-scrollbar-thumb:hover {
      background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--brand-light) 48%, var(--surface-3)),
        color-mix(in srgb, var(--brand) 40%, var(--surface-3))
      );
      box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--brand-border) 70%, transparent),
        0 0 10px color-mix(in srgb, var(--brand-light) 16%, transparent);
    }
    .settings-content::-webkit-scrollbar-button {
      display: none;
      height: 0;
      width: 0;
    }
    .settings-content h2 {
      font-size: 1rem; font-weight: 600; margin-bottom: 1rem;
    }
    .settings-field {
      margin-bottom: 1rem;
    }
    .settings-field-label {
      font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase;
      letter-spacing: 1px; font-weight: 600; margin-bottom: 0.3rem;
    }
    .settings-field-value {
      font-size: 0.88rem; color: var(--text); font-family: 'SF Mono', 'Cascadia Code', monospace;
    }
    .settings-close {
      position: absolute; top: 1rem; right: 1rem;
      background: none; border: none; color: var(--text-muted); font-size: 1.2rem;
      cursor: pointer; width: 28px; height: 28px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      transition: all 0.12s;
    }
    .settings-close:hover { background: var(--surface-3); color: var(--text); }

    /* Source sub-tabs */
    .source-tabs {
      display: flex; gap: 0.25rem; margin-bottom: 1.25rem;
      background: var(--surface-2); border-radius: 10px; padding: 3px;
      border: 1px solid var(--border);
    }
    .source-tab {
      background: none; border: none; color: var(--text-muted); font-family: inherit;
      font-size: 0.78rem; font-weight: 500; padding: 0.4rem 1rem; border-radius: 8px;
      cursor: pointer; transition: all 0.15s; flex: 1; text-align: center;
    }
    .source-tab:hover { color: var(--text); }
    .source-tab.active { background: var(--accent); color: #fff; font-weight: 600; }

    /* Card toggle row */
    .card-toggle-row {
      display: flex; align-items: center; justify-content: space-between;
      padding: 0.65rem 0; border-bottom: 1px solid var(--border);
    }
    .card-toggle-row:last-child { border-bottom: none; }
    .card-toggle-info { display: flex; flex-direction: column; gap: 0.15rem; }
    .card-toggle-name { font-size: 0.82rem; font-weight: 500; }
    .card-toggle-meta { font-size: 0.65rem; color: var(--text-muted); }
    .card-toggle-inactive { font-size: 0.6rem; color: var(--yellow); font-weight: 600; }

    /* Toggle switch */
    .toggle-switch {
      position: relative; width: 38px; height: 22px; flex-shrink: 0;
    }
    .toggle-switch input { opacity: 0; width: 0; height: 0; }
    .toggle-slider {
      position: absolute; inset: 0; background: var(--surface-3);
      border-radius: 11px; cursor: pointer; transition: background 0.2s;
      border: 1px solid var(--border);
    }
    .toggle-slider::before {
      content: ''; position: absolute; height: 16px; width: 16px;
      left: 2px; bottom: 2px; background: var(--text-muted);
      border-radius: 50%; transition: all 0.2s;
    }
    .toggle-switch input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
    .toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); background: #fff; }

    /* Under dev */
    .under-dev {
      text-align: center; padding: 2.5rem 1rem; color: var(--text-muted);
    }
    .under-dev-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
    .under-dev h3 { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 0.35rem; }
    .under-dev p { font-size: 0.78rem; line-height: 1.5; max-width: 300px; margin: 0 auto; }

    .loading { text-align: center; padding: 3rem; color: var(--text-muted); }

    /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
       MOBILE NAV BAR
       â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
    .mobile-nav {
      display: none;
      position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
      background: var(--surface); border-top: 1px solid var(--border);
      padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .mobile-nav-item {
      flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.22rem;
      padding: 0.55rem 0.5rem; background: none; border: none;
      color: var(--text-muted); font-family: inherit; font-size: 0.6rem;
      font-weight: 500; letter-spacing: 0.2px; cursor: pointer; transition: color 0.15s;
      min-height: 52px;
    }
    .mobile-nav-item svg { width: 21px; height: 21px; transition: stroke 0.15s; }
    .mobile-nav-item.active { color: var(--accent-light); }
    .mobile-nav-item span { line-height: 1; }

    /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
       RESPONSIVE â€” TABLET / PHONE  â‰¤ 768px
       â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
    @media (max-width: 768px) {
      /* Show mobile nav, hide desktop tabs */
      .mobile-nav { display: flex; }
      .nav-tabs { display: none; }

      /* Body: room for mobile nav (upload-bar hidden on mobile) */
      body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }

      /* Upload bar hidden â€” mobile users use Gmail sync */
      .upload-bar { display: none; }

      /* Header: compact single row */
      .header { padding: 0.6rem 1rem; }
      .header h1 { font-size: 1rem; }
      .header .brand { letter-spacing: 2px; font-size: 0.6rem; }
      .header-left { gap: 0.75rem; }
      .user-info { display: none; }
      .user-badge { gap: 0.5rem; }
      .avatar { width: 30px; height: 30px; font-size: 0.7rem; }
      .settings-btn { width: 32px; height: 32px; }

      /* Container */
      .content { padding: 0.9rem 1rem; }
      .page-panel { padding: 1.1rem 1rem 1.25rem; }

      /* Selectors: wrap naturally */
      .selectors { gap: 0.65rem; }
      .sel-group select { font-size: 0.8rem; padding: 0.38rem 0.65rem; }
      .sel-badge { font-size: 0.64rem; margin-left: 0; }

      /* KPI strip: 2 columns on tablet */
      .kpi-strip { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 0.65rem; }
      .kpi { padding: 0.9rem 1rem; }
      .kpi .kpi-value { font-size: 1.1rem; }

      /* Panels: already 1-col at 960px, keep it */
      .panels { grid-template-columns: 1fr; }

      /* Insights strip: already 1-col at 900px */
      .insights-strip { grid-template-columns: 1fr; }

      /* Chart heights: shorter for mobile viewports */
      .ts-chart-wrap { height: 200px; }
      .chart-wrap { height: 200px; }
      .ts-panel { padding: 1.1rem; }
      .panel { padding: 1rem; }

      /* Transaction table: horizontal scroll wrapper */
      .tx-section { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 1rem; }
      .tx-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
      .tx-table { min-width: 540px; font-size: 0.79rem; }
      .tx-table th, .tx-table td { padding: 0.5rem 0.4rem; }
      .tx-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
      .tx-filters { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 0.25rem; scrollbar-width: none; }
      .tx-filters::-webkit-scrollbar { display: none; }

      /* Overview controls: allow wrap */
      .overview-controls { gap: 0.5rem; }
      .view-toggle button { padding: 0.4rem 0.75rem; font-size: 0.74rem; }
      .card-selector { flex-wrap: wrap; }
      .card-selector select { font-size: 0.8rem; }
      .ts-legend { gap: 0.4rem 0.75rem; }
      .ts-legend-item { font-size: 0.65rem; }

      /* Settings modal â†’ bottom sheet */
      .modal-overlay.is-sheet { align-items: flex-end; }
      .settings-box {
        max-width: 100%; width: 100%; max-height: 92vh;
        border-radius: 20px 20px 0 0; flex-direction: column;
      }
      .settings-sidebar {
        width: 100%; min-width: unset; border-right: none;
        border-bottom: 1px solid var(--border);
        flex-direction: row; padding: 0.5rem 0.5rem 0;
        overflow-x: auto; -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
      }
      .settings-sidebar::-webkit-scrollbar { display: none; }
      .settings-sidebar-title { display: none; }
      .settings-sidebar-bottom {
        margin-top: 0; padding: 0 0 0 0.5rem;
        border-top: none; border-left: 1px solid var(--border);
        margin-left: auto; flex-direction: row; align-items: center; flex-shrink: 0;
      }
      .stab { padding: 0.55rem 0.9rem; white-space: nowrap; font-size: 0.78rem; }
      .stab-logout { padding: 0.55rem 0.9rem; white-space: nowrap; font-size: 0.78rem; }
      .stab-logout svg { display: none; }
      .settings-content { padding: 1.25rem; }
      .settings-close { top: 0.6rem; right: 0.75rem; }

      /* TX detail modal â†’ bottom sheet */
      .tx-detail-box {
        width: 100%; max-height: 88vh;
        border-radius: 20px 20px 0 0;
      }
      .tx-detail-header { padding: 1.1rem 3rem 0.85rem 1.25rem; flex-wrap: wrap; gap: 0.65rem; }
      .tx-detail-total { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 0.5rem; width: 100%; text-align: left; }
      .tx-detail-body { padding: 0.6rem 0.5rem 1rem; }
      .tx-row { padding: 0.75rem 0.9rem; }

      /* Toast: top on mobile (avoids nav overlap) */
      .toast-stack {
        top: 4.2rem; bottom: auto;
        left: 1rem; right: 1rem; max-width: unset;
      }

      /* Empty CTA */
      .empty-cta { margin: 2rem auto 0; padding: 1.75rem 1.25rem; }
      .empty-cta h2 { font-size: 1.15rem; }
      .sync-notice { font-size: 0.83rem; }
      .empty-state { padding: 3rem 1.25rem; }

      /* Confirm modal: bigger on mobile */
      .modal-box { padding: 1.5rem; width: 92%; }
    }

    /* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
       SMALL PHONES  â‰¤ 480px
       â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
    @media (max-width: 480px) {
      .header { padding: 0.55rem 0.85rem; }
      .header h1 { font-size: 0.9rem; }
      .content { padding: 0.75rem; }
      .page-panel { padding: 1rem 0.85rem 1.15rem; }

      /* KPI: 2 tight columns */
      .kpi-strip { grid-template-columns: 1fr 1fr; gap: 0.55rem; }
      .kpi { padding: 0.75rem 0.8rem; }
      .kpi .kpi-value { font-size: 0.95rem; }
      .kpi .kpi-label { font-size: 0.58rem; }
      .kpi .kpi-sub { font-size: 0.65rem; }

      /* Selectors: stack vertically */
      .selectors { flex-direction: column; align-items: stretch; gap: 0.5rem; }
      .sel-group { flex-direction: column; align-items: flex-start; gap: 0.25rem; width: 100%; }
      .sel-group select { width: 100%; }
      .sel-badge { width: 100%; justify-content: flex-start; }

      /* Charts even shorter */
      .ts-chart-wrap { height: 170px; }
      .chart-wrap { height: 170px; }

      /* Insight cards: smaller */
      .insight-card { padding: 0.9rem 1rem; }
      .insight-title { font-size: 0.82rem; }
      .insight-body { font-size: 0.75rem; }

      /* TS legend: tighter */
      .ts-legend { gap: 0.3rem 0.5rem; }
      .ts-panel-title { font-size: 0.82rem; }

      /* TX table columns: narrower */
      .tx-table { min-width: 500px; font-size: 0.75rem; }

      /* Modals */
      .settings-box { max-height: 95vh; }
      .tx-detail-box { max-height: 92vh; }
      .tx-detail-title { font-size: 0.95rem; }
    }
