input, select {
  height: 46px;
  padding-left: 13px;
  padding-right: 13px;
}

input[type="number"] {
  font-size: 17px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.claim-row {
  grid-template-columns: minmax(170px, 1.35fr) minmax(165px, 1.1fr) minmax(145px, 1fr) minmax(145px, 1fr) auto;
}
.claim-row.has-custom-rate { grid-template-columns:minmax(160px,1.25fr) minmax(135px,.9fr) minmax(130px,.85fr) minmax(130px,.85fr) minmax(145px,.85fr) auto; }
.custom-interest-setting { padding:16px; border:1px solid #a7bdc9; border-radius:10px; background:#f6fafb; }
.custom-interest-setting>p { margin:8px 0 0; color:#647080; font-size:14px; }
.custom-interest-controls { margin-top:14px; }
.custom-interest-controls[hidden] { display:none; }
.custom-interest-controls button { width:100%; min-height:40px; margin-top:10px; padding:8px 12px; border:1px solid #9cb8cb; border-radius:8px; background:#fff; color:#175b8f; font-weight:700; cursor:pointer; }
.custom-interest-controls small { display:block; margin-top:8px; color:#647080; }

.payment-row {
  grid-template-columns: minmax(170px, 1.1fr) minmax(165px, 1fr) minmax(145px, 1fr) minmax(180px, 1.3fr) auto;
}

.action-card {
  grid-template-columns: auto minmax(130px, 1fr) 82px 125px minmax(85px, auto);
}

.action-card input[type="number"] { height: 42px; }

.fee-search { display:flex; align-items:center; gap:10px; padding:7px 9px 7px 14px; margin-bottom:8px; border:1px solid #9cb8cb; border-radius:10px; background:#fff; }
.fee-search span { color:#175b8f; font-size:25px; line-height:1; }
.fee-search input { border:0; margin:0; height:42px; box-shadow:none; outline:none; font-weight:500; }
.fee-search button { border:0; background:#eef5f8; color:#175b8f; border-radius:7px; padding:10px 12px; font-weight:700; cursor:pointer; }
.fee-meta { display:flex; justify-content:space-between; gap:12px; margin:0 2px 15px; color:#647080; font-size:13px; }
.action-card .tariff-no { display:inline-block; margin-right:6px; color:#175b8f; }
.action-card .basis-label { font-size:12px; color:#647080; text-align:center; }
.action-card.hidden-fee { display:none; }
.no-fees { grid-column:1/-1; padding:28px; text-align:center; color:#647080; border:1px dashed #bbc6cd; border-radius:10px; }

/* Каталогът е на цял ред, за да не се изрязват полетата и крайната сума. */
.action-grid { grid-template-columns: 1fr; }
.action-card { min-width: 0; }
.action-card > div { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 1250px) {
  main { grid-template-columns: 1fr; }
  .summary { position: static; }
}

@media (max-width: 980px) {
  .claim-row, .payment-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .claim-row, .payment-row { grid-template-columns: 1fr; }
  .action-card { grid-template-columns: 28px minmax(0, 1fr); align-items: start; }
  .action-card > input[type="checkbox"] { grid-column: 1; grid-row: 1; margin-top: 3px; }
  .action-card > div { grid-column: 2; grid-row: 1; }
  .action-card > input[type="number"], .action-card > .price { grid-column: 2; width: 100%; }
  .action-card > .price { text-align: left; padding: 4px 2px 2px; }
  .fee-meta { flex-direction: column; gap: 2px; }
}

#printReport { display:none; }
.save-top { height:40px; padding:0 14px; border:0; border-radius:8px; background:#d4a854; color:#14283a; font-weight:750; cursor:pointer; }
.plan-badge { display:inline-flex; align-items:center; height:30px; padding:0 10px; border:1px solid rgba(255,255,255,.3); border-radius:999px; background:rgba(255,255,255,.08); color:#dbe4ea; font-size:12px; font-weight:750; white-space:nowrap; }
.license-button { height:40px; padding:0 13px; border:1px solid rgba(255,255,255,.42); border-radius:8px; background:transparent; color:#fff; font-weight:750; cursor:pointer; white-space:nowrap; }
.license-button:hover { background:rgba(255,255,255,.08); }
.license-button:focus-visible { outline:3px solid rgba(255,255,255,.22); outline-offset:2px; }
.license-dialog { width:min(440px,calc(100% - 28px)); padding:0; border:0; border-radius:14px; color:#17202b; box-shadow:0 24px 70px rgba(10,27,42,.32); }
.license-dialog::backdrop { background:rgba(10,24,36,.58); backdrop-filter:blur(2px); }
.license-card { padding:27px; }
.license-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:22px; }
.license-head h2 { margin:3px 0 0; color:#102a43; font:650 26px Georgia,serif; }
.license-close { width:36px; height:36px; padding:0; border:0; border-radius:7px; background:#eef1f3; color:#52616d; font-size:23px; cursor:pointer; }
.license-card input { margin:7px 0 14px; }
.license-activate { display:flex; align-items:center; justify-content:center; width:100%; height:44px; border:0; border-radius:8px; background:#175b8f; color:#fff; font-weight:750; text-decoration:none; cursor:pointer; }
.license-activate:disabled,.license-deactivate:disabled { opacity:.65; cursor:wait; }
.license-intro,.license-card p { margin:0 0 18px; color:#647080; font-size:14px; }
.license-status:empty { display:none; }
.license-status:not(:empty) { margin:15px 0 0; padding:11px 12px; border-radius:7px; background:#f1f7f8; color:#3f5663; }
.license-details { margin:0 0 20px; border:1px solid #dde2e7; border-radius:9px; overflow:hidden; }
.license-details div { display:flex; justify-content:space-between; gap:18px; padding:12px 14px; border-top:1px solid #dde2e7; }
.license-details div:first-child { border-top:0; }
.license-details dt { color:#647080; }
.license-details dd { margin:0; font-weight:750; }
.active-status { color:#276749; }
.license-deactivate { width:100%; min-height:44px; padding:8px 14px; border:1px solid #9cb8cb; border-radius:8px; background:#fff; color:#175b8f; font-weight:750; cursor:pointer; }
.upgrade-copy { line-height:1.55; }
.upgrade-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.saved-calculations { margin-top:20px; padding:17px; border:1px solid #cbd7df; border-radius:10px; background:#f8fafb; }
.saved-head { display:flex; align-items:end; justify-content:space-between; gap:16px; margin-bottom:10px; }
.saved-head h3 { margin:2px 0 0; font:650 20px Georgia,serif; }
.saved-head>span { color:#647080; font-size:12px; }
.saved-item { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:9px; padding:10px 0; border-top:1px solid #dde2e7; }
.saved-item:first-child { border-top:0; }
.saved-item strong,.saved-item small { display:block; }
.saved-item small { margin-top:2px; color:#647080; }
.saved-item button { height:35px; padding:0 11px; border:1px solid #9cb8cb; border-radius:7px; background:#fff; color:#175b8f; font-weight:700; cursor:pointer; }
.saved-item .delete-saved { border-color:#e1c1c1; color:#a53f3f; }
@media(max-width:620px){.top-controls{flex-wrap:wrap}.plan-badge{order:-2}.license-button{order:-1}.save-top,.ghost{flex:1}.saved-item{grid-template-columns:1fr 1fr}.saved-item>div{grid-column:1/-1}.license-card{padding:22px}}
@page { size:A4 portrait; margin:8mm 8mm 8mm 18mm; }
@media print {
  header,main,footer { display:none!important; }
  body { background:#fff; color:#111; font-family:Arial,sans-serif; }
  #printReport { display:block!important; width:100%; font-size:9.2pt; line-height:1.2; }
  .pr-head { display:flex; justify-content:space-between; align-items:flex-end; padding-bottom:5px; border-bottom:2px solid #102a43; }
  .pr-head h1 { margin:0; font:700 17pt Georgia,serif; color:#102a43; }
  .pr-head p { margin:2px 0 0; color:#555; }
  .pr-date { text-align:right; white-space:nowrap; }
  .pr-section { margin-top:7px; break-inside:avoid; }
  .pr-section h2 { margin:0 0 3px; padding:3px 5px; background:#e8f0f4; color:#102a43; font-size:10.5pt; }
  .pr-table { width:100%; border-collapse:collapse; table-layout:fixed; }
  .pr-table th,.pr-table td { padding:2.5px 4px; border-bottom:1px solid #d5d5d5; text-align:left; vertical-align:top; overflow-wrap:anywhere; }
  .pr-table th { font-size:8.2pt; color:#555; }
  .pr-section:first-of-type .pr-table th:nth-child(5),.pr-table td.pr-rate-column { display:none; }
  .pr-table .num { text-align:right; white-space:nowrap; }
  .pr-total-row td { font-weight:700; border-top:1px solid #777; }
  .pr-summary { display:grid; grid-template-columns:1fr 1fr; gap:0 18px; margin-top:7px; padding:6px 9px; border:1px solid #9eacb5; break-inside:avoid; }
  .pr-summary div { display:flex; justify-content:space-between; padding:2px 0; border-bottom:1px dotted #bbb; }
  .pr-grand { grid-column:1/-1; margin-top:3px; padding-top:4px!important; border-top:2px solid #102a43!important; border-bottom:0!important; font-size:11pt; color:#102a43; }
  .pr-note { margin:5px 0 0; color:#666; font-size:6.8pt; }
}
