/* ============================================================
   Фінанси та звіти (для ПК — таблиці; на телефоні гортаються вбік)
   ============================================================ */

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  white-space: nowrap;
}

.table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 11px 12px 9px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  position: sticky;
  top: 0;
}

.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .wrap { white-space: normal; min-width: 180px; }
.table tbody tr[data-op] { cursor: pointer; }
.table tbody tr[data-op]:hover, .table tbody tr.is-hover:hover { background: var(--violet-050); }
.table tfoot td { font-weight: 750; background: var(--surface-2); border-top: 1px solid var(--border-strong); }
.table .row-strong td { font-weight: 750; }
.table .row-sub td:first-child { padding-left: 28px; color: var(--text-muted); }
.table .row-sep td { background: var(--surface-2); font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-soft); }

.plus { color: var(--success); }
.minus { color: var(--danger); }

.table select.input, .table input.input { padding: 7px 9px; font-size: 13px; border-radius: 10px; min-width: 150px; }
.table input[type='checkbox'] { width: 17px; height: 17px; accent-color: var(--violet-600); }
.table tr.is-dup td { opacity: 0.45; }

.bar {
  height: 6px;
  border-radius: 999px;
  background: var(--violet-100);
  overflow: hidden;
  min-width: 80px;
}

.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--violet-500), var(--violet-700)); border-radius: 999px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .select-wrap { min-width: 170px; }
.toolbar .input { padding: 9px 12px; font-size: 14px; }
.toolbar .search { margin: 0; flex: 1; min-width: 180px; }

.account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }

.account {
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.account::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--violet-300); }
.account--cash::before { background: var(--success); }
.account--bank::before { background: var(--info); }
.account--off { opacity: 0.5; }
.account__name { font-weight: 650; font-size: 14px; color: var(--text-muted); }
.account__balance { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.account__meta { font-size: 12px; color: var(--text-soft); margin-top: 4px; }

.subtabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }

.hint-box {
  background: var(--info-bg);
  color: var(--info);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  margin-bottom: 12px;
}

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 16px;
  border: 2px dashed var(--violet-300);
  border-radius: var(--radius-lg);
  background: var(--violet-050);
  color: var(--violet-700);
  font-weight: 650;
  cursor: pointer;
  text-align: center;
}

.drop span { font-size: 30px; }
.drop.is-over { background: var(--violet-100); }

@media print {
  .tabbar, .chips, .toolbar, .subtabs, .header__actions, .no-print, .toast { display: none !important; }
  body { background: #fff !important; }
  .app { padding: 0 !important; max-width: none !important; }
  .table-wrap { box-shadow: none; border-color: #ccc; overflow: visible; }
  .table { font-size: 11px; }
}
