:root { --bg:#fafafa; --card:#fff; --text:#111; --muted:#666; --border:#e7e7e7; }
*{ box-sizing:border-box; }
body{ margin:0; background:var(--bg); color:var(--text); font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial; }
.container{ max-width:1100px; margin:24px auto; padding:0 16px 24px; }
.header{ padding:10px 0 14px; }
h1{ margin:0 0 8px; font-size:34px; }
h2{ margin:0 0 12px; font-size:18px; }
.muted{ margin:0; color:var(--muted); }
.card{ background:var(--card); border:1px solid var(--border); border-radius:14px; padding:16px; margin:14px 0; }
.grid{ display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:12px; }
label{ display:flex; flex-direction:column; gap:6px; font-size:13px; }
input, select{ padding:10px 12px; border:1px solid var(--border); border-radius:10px; font-size:14px; background:white; }
.span-2{ grid-column: span 2; }
.table-wrap{ overflow:auto; border:1px solid var(--border); border-radius:12px; }
table{ width:100%; border-collapse:collapse; }
th, td{ padding:10px; border-bottom:1px solid var(--border); font-size:14px; vertical-align:middle; }
th{ background:#fcfcfc; text-align:left; position:sticky; top:0; }
.right{ text-align:right; }
.row-between{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.row-actions{ display:flex; gap:10px; }
.actions{ display:flex; justify-content:flex-end; padding-top:12px; }
.btn{ border:1px solid var(--border); background:white; padding:10px 12px; border-radius:12px; cursor:pointer; font-size:14px; }
.btn.primary{ border-color:#111; background:#111; color:white; }
.btn.danger{ border-color:#ffdddd; }
/* ===== Payments as cards grid (desktop + mobile) ===== */

/* махаме хоризонталния скрол */
.table-wrap { overflow-x: hidden; }

/* скриваме table header, защото вече имаме labels */
#payments thead { display: none; }

/* превръщаме tbody в GRID контейнер */
#payments tbody {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

/* всеки tr става card */
#payments tbody tr {
  display: block;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

/* td стават редове "label : control" */
#payments tbody td {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

#payments tbody td:last-child {
  border-bottom: none;
}

/* label от data-label */
#payments tbody td::before {
  content: attr(data-label);
  font-weight: 600;
  opacity: 0.75;
  flex: 0 0 110px;
}

/* inputs/select да не излизат */
#payments input,
#payments select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* действията вдясно */
#payments tbody td.right {
  justify-content: flex-end;
}

/* ===== Responsive breakpoints ===== */
@media (max-width: 1100px) {
  #payments tbody { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  #payments tbody { grid-template-columns: 1fr; }

  .row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
  }

  .btn { width: 100%; }
  .btn.primary { width: 100%; }
}
