/* All new styling is scoped to GP; other PKO panels keep their current layout. */
.gp-root { display:grid; gap:16px; min-width:0; margin-top:8px; }
.gp-root .panel { margin:0; min-width:0; }
.gp-heading,.gp-journal-title,.gp-record-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.gp-heading h3,.gp-journal h3 { margin:0; }
.gp-heading p { margin:4px 0 0; }
.gp-actions,.gp-row-actions,.gp-pagination,.gp-dialog-footer { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.gp-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; align-items:end; }
.gp-field { display:flex; flex-direction:column; gap:6px; min-width:0; font-size:.82rem; color:var(--muted); }
.gp-field input,.gp-field select,.gp-field textarea { width:100%; min-width:0; min-height:40px; border:1px solid var(--line); border-radius:var(--radius-sm); padding:9px 10px; background:var(--surface); color:var(--ink); }
.gp-field textarea { resize:vertical; }
.gp-filters>.gp-actions { grid-column:span 2; }
.gp-notice { margin:0; font-size:.85rem; color:var(--accent-dark); overflow-wrap:anywhere; }
.gp-notice:empty { display:none; }
.gp-error { color:var(--red); }
.gp-statistics h4 { margin:0 0 10px; font-size:.88rem; }
.gp-statistics h4:not(:first-child) { margin-top:18px; }
.gp-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.gp-metrics-period { grid-template-columns:repeat(3,minmax(0,1fr)); }
.gp-metric { border:1px solid var(--line); background:var(--soft); border-radius:var(--radius-sm); padding:12px; display:flex; flex-direction:column; gap:8px; }
.gp-metric span { font-size:.78rem; color:var(--muted); }
.gp-metric strong { font-size:1.45rem; font-variant-numeric:tabular-nums; }
.gp-metric-waiting { border-left:3px solid var(--amber); }
.gp-metric-sent { border-left:3px solid var(--blue); }
.gp-metric-paid { border-left:3px solid var(--accent); }
.gp-stats-hint,.gp-summary,.gp-form-hint { font-size:.77rem; margin:8px 0 12px; }
.gp-table-wrap { overflow-x:auto; max-width:100%; }
.gp-table { width:100%; border-collapse:collapse; font-size:.79rem; }
.gp-table th,.gp-table td { text-align:left; vertical-align:top; padding:12px 8px; border-bottom:1px solid var(--line); }
.gp-table th { color:var(--muted); background:var(--soft); font-size:.74rem; font-weight:600; }
.gp-table td:nth-child(2) { min-width:185px; width:24%; }
.gp-table th:nth-child(7),.gp-table td:nth-child(7) { min-width:160px; }
.gp-filename,.gp-note { overflow-wrap:anywhere; white-space:pre-wrap; }
.gp-filename { font-weight:600; }
.gp-note { max-width:260px; }
.gp-copy { border:0; padding:5px 0; background:none; color:var(--accent-dark); text-align:left; font-size:.73rem; }
.gp-status { display:inline-flex; align-items:center; border-radius:999px; font-size:.72rem; font-weight:600; line-height:1.4; padding:5px 9px; }
.gp-status-waiting { color:var(--amber); background:var(--amber-soft); }
.gp-status-sent { color:var(--blue); background:var(--blue-soft); }
.gp-status-paid { color:var(--accent-dark); background:var(--accent-soft); }
.gp-row-actions { align-items:stretch; flex-direction:column; min-width:132px; }
.gp-row-actions .btn { font-size:.71rem; padding:6px 8px; min-height:32px; white-space:normal; }
.gp-pagination { justify-content:center; margin-top:16px; font-size:.8rem; }
.gp-pagination .btn { font-size:.78rem; }
.gp-empty { padding:22px; text-align:center; color:var(--muted); }
.gp-archived { display:block; font-size:.71rem; color:var(--muted); margin-top:4px; }
.gp-mobile-records { display:none; }
.gp-dialog { width:min(760px,calc(100% - 28px)); max-height:calc(100dvh - 36px); border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); color:var(--ink); padding:22px; box-shadow:var(--shadow-lg); overflow:auto; }
.gp-dialog::backdrop { background:rgba(15,22,32,.54); }
.gp-dialog-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:16px; }
.gp-dialog-heading h3 { margin:0; font-size:1.12rem; }
.gp-dialog-heading .btn { min-height:30px; padding:4px 9px; width:auto; flex:none; }
.gp-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.gp-form-wide { grid-column:1/-1; }
.gp-form-error { overflow-wrap:anywhere; font-size:.84rem; }
.gp-dialog-footer { justify-content:flex-end; margin-top:20px; }
.gp-duplicate { border:1px solid var(--amber); border-radius:var(--radius-sm); padding:12px; font-size:.85rem; }
.gp-duplicate p { margin:0 0 8px; }
.gp-duplicate input { width:auto; margin-right:6px; }
.gp-detail { display:grid; gap:10px; margin:0 0 24px; }
.gp-detail>div { display:grid; grid-template-columns:minmax(130px,1fr) 2fr; gap:12px; }
.gp-detail dt { color:var(--muted); }
.gp-detail dd { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.gp-history { padding-left:22px; font-size:.83rem; }
.gp-history>li { margin-bottom:18px; padding-left:4px; }
.gp-history p { margin:4px 0; font-size:.74rem; }
.gp-history ul { padding-left:18px; }
.gp-history li { overflow-wrap:anywhere; }
@media(max-width:1100px) { .gp-filters { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:820px) {
  .pko-hscroll.gp-active { overflow:visible; }
  .pko-hscroll.gp-active .pko-hscroll-inner { min-width:0; }
  .pko-hscroll.gp-active .section-grid { grid-template-columns:minmax(0,1fr); }
  .pko-hscroll.gp-active .section-grid>* { min-width:0; }
  .pko-hscroll.gp-active #pko-status-badge { display:none; }
  .gp-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .gp-table-wrap { display:none; }
  .gp-mobile-records { display:grid; gap:12px; }
  .gp-mobile-record { border:1px solid var(--line); padding:14px; border-radius:var(--radius-sm); }
  .gp-mobile-record .gp-filename { margin-top:10px; }
  .gp-mobile-record dl { font-size:.78rem; display:grid; gap:6px; }
  .gp-mobile-record dl>div { display:flex; justify-content:space-between; gap:12px; }
  .gp-mobile-record dt { color:var(--muted); }
  .gp-mobile-record dd { margin:0; }
  .gp-mobile-record .gp-note { max-width:none; font-size:.82rem; }
  .gp-row-actions { flex-direction:row; flex-wrap:wrap; }
  .gp-root .gp-actions .btn,.gp-root .gp-row-actions .btn { min-height:40px; white-space:normal; }
  .gp-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .gp-metrics-period { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:480px) {
  .gp-heading .gp-actions { width:100%; }
  .gp-heading .gp-actions .btn { flex:1; }
  .gp-filters,.gp-form-grid { grid-template-columns:1fr; }
  .gp-filters>.gp-actions { grid-column:auto; }
  .gp-metrics-period { grid-template-columns:1fr; }
  .gp-metric { padding:10px; }
  .gp-dialog { padding:16px; }
  .gp-detail>div { grid-template-columns:1fr; gap:3px; }
  .gp-form .gp-field input,.gp-form .gp-field select,.gp-form .gp-field textarea { font-size:16px; }
}

/* Status applies to the whole register; owner identity has its own badge. */
.gp-record-waiting { --gp-record-bg:#fffaf0; --gp-record-edge:#e8c878; --gp-record-accent:#d18b13; }
.gp-record-sent { --gp-record-bg:#eff6ff; --gp-record-edge:#b4cff2; --gp-record-accent:#3980cf; }
.gp-record-paid { --gp-record-bg:#edf9f2; --gp-record-edge:#acd8bc; --gp-record-accent:#2c9a68; }
.gp-table { border-collapse:separate; border-spacing:0 10px; }
.gp-table thead th { border-bottom:0; padding-top:12px; padding-bottom:12px; }
.gp-table tbody tr.gp-record>td { background:var(--gp-record-bg); border-top:1px solid var(--gp-record-edge); border-bottom:1px solid var(--gp-record-edge); padding:14px 9px; }
.gp-table tbody tr.gp-record>td+td { border-left:1px solid color-mix(in srgb,var(--gp-record-edge) 45%,transparent); }
.gp-table tbody tr.gp-record>td:first-child { border-left:4px solid var(--gp-record-accent); border-radius:12px 0 0 12px; }
.gp-table tbody tr.gp-record>td:last-child { border-right:1px solid var(--gp-record-edge); border-radius:0 12px 12px 0; }
.gp-record-number { font-size:.75rem; font-weight:700; color:var(--muted); white-space:nowrap; }
.gp-owner { display:inline-flex; align-items:center; gap:7px; border:1px solid var(--gp-owner-edge,#d1d5db); border-radius:999px; padding:5px 9px 5px 5px; font-size:.76rem; font-weight:700; background:var(--gp-owner-bg,#f1f5f9); color:var(--gp-owner-ink,#475569); white-space:nowrap; }
.gp-owner-nikolay { --gp-owner-bg:#f0eaff; --gp-owner-ink:#6941b5; --gp-owner-edge:#d7c6f2; }
.gp-owner-kirill { --gp-owner-bg:#e4f3fc; --gp-owner-ink:#075985; --gp-owner-edge:#afd6ed; }
.gp-owner-initial { display:inline-grid; place-items:center; width:22px; height:22px; border-radius:50%; background:rgba(255,255,255,.75); font-size:.7rem; }
.gp-file-field { padding:10px; border:1px solid var(--gp-record-edge,var(--line)); border-radius:9px; background:rgba(255,255,255,.72); }
.gp-file-tools { display:flex; gap:5px 10px; align-items:center; flex-wrap:wrap; margin-top:8px; }
.gp-file-tools .gp-copy { margin:0; }
.gp-quantity { display:inline-flex; font-size:.7rem; font-weight:700; border-radius:6px; padding:4px 7px; background:var(--soft); color:var(--ink); }
.gp-quantity-unknown { background:var(--amber-soft); color:var(--amber); font-weight:500; }
.gp-date { display:inline-block; padding:5px 6px; border:1px solid rgba(255,255,255,.9); border-radius:6px; background:rgba(255,255,255,.65); white-space:nowrap; font-variant-numeric:tabular-nums; }
.gp-status { border:1px solid transparent; padding:6px 10px; box-shadow:0 1px 2px rgba(16,24,40,.05); }
.gp-status::before { content:""; width:6px; height:6px; flex:none; border-radius:50%; background:currentColor; margin-right:6px; }
.gp-status-waiting { background:#feefc3; color:#92400e; border-color:#e8bf56; }
.gp-status-sent { background:#dceaff; color:#1d4ed8; border-color:#91b5eb; }
.gp-status-paid { background:#d1f3df; color:#11603e; border-color:#7dc79d; }
.gp-mobile-record.gp-record { background:var(--gp-record-bg); border:1px solid var(--gp-record-edge); border-left:4px solid var(--gp-record-accent); box-shadow:0 2px 6px rgba(16,24,40,.03); }
.gp-mobile-record .gp-file-field { margin-top:12px; }
.gp-mobile-record .gp-file-field .gp-filename { margin-top:0; }
.gp-mobile-record dl>div { padding:7px; border-radius:6px; background:rgba(255,255,255,.65); }
.gp-owner-totals { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:12px; }
.gp-owner-total { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:10px; padding:14px; border:1px solid #b9d3ef; border-radius:var(--radius-sm); background:linear-gradient(135deg,#f8fbff,#eef5fd); }
.gp-owner-total p { margin:6px 0 0; font-size:.78rem; color:var(--muted); }
.gp-owner-total-value { display:flex; flex-direction:column; gap:4px; text-align:right; }
.gp-owner-total-value strong { color:#1e4778; font-size:1.3rem; font-variant-numeric:tabular-nums; }
.gp-owner-total-value span { font-size:.72rem; color:var(--muted); }
.gp-owner-total .gp-quantity-warning { flex-basis:100%; color:#92400e; padding:7px 9px; border-radius:6px; background:#fff4d6; }
@media(max-width:820px) { .gp-owner-totals { grid-template-columns:1fr; } }
@media(max-width:480px) { .gp-owner-total { padding:12px; } .gp-record-heading { gap:8px; } .gp-record-heading .gp-status { margin-left:auto; } }
