:root{
  --bg:#f4f6fb;
  --card:#fff;
  --ink:#0f172a;
  --muted:#64748b;
  --line:#e2e8f0;
  --brand:#0b64d8;
  --danger:#ef4444;
  --warn:#f59e0b;
  --ok:#10b981;
  --chip:#eef2ff;
  --note:#fff7ed;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; font-family:Inter,system-ui,Arial,sans-serif; color:var(--ink);
  background:var(--bg);
}

.site-header,.site-footer{
  border-bottom:1px solid var(--line);
  padding:.75rem 1rem;
}
.site-footer{padding-bottom: 25px; font-size:.9rem}

.logo{height:40px}

.container{max-width:1100px; margin:1rem auto; padding:0 1rem; margin-top: 0px; margin-bottom: 0px;}

.grid{display:grid; gap:0.75rem}
.grid-2{grid-template-columns:1fr 1fr; margin-bottom: 0.75em;}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
@media (max-width:900px){ .grid-2{grid-template-columns:1fr} .grid-3{grid-template-columns:1fr 1fr} }

.card{
  background:var(--card); border:1px solid var(--line); border-radius:16px;
  padding:1rem 1.2rem; box-shadow:0 2px 8px rgba(16,24,40,.04)
}
.card-title{margin:0 0 .5rem}
.card-title-row{display:flex; align-items:center; justify-content:space-between}
.card-head h1{margin:.25rem 0 .25rem; font-size:1.4rem}
.muted{color:var(--muted)}
.small{font-size:.9rem}
.center{text-align:center}
.meta .label{font-size:.8rem; color:var(--muted)}
.meta .value{font-weight:600; margin-top:.25rem}

.note{
  margin-top:1rem; background:var(--note); border:1px solid #fed7aa;
  padding:.75rem 1rem; border-radius:12px; font-size:.95rem
}

.progress {
  width: 100%;
  height: 16px;
  background: #e8ecf3;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.08);
  margin-top: 0.75em;
}

.progress-inner {
  display: flex;
  width: 100%;
  height: 100%;
}

.progress-used {
  background: linear-gradient(90deg, #0b64d8, #3482ff);
  border-radius: inherit;
  transition: width 0.5s cubic-bezier(.25,.8,.25,1);
}

.progress-over {
  background: linear-gradient(90deg, #fd5353, #e11d48);
  border-radius: 0 999px 999px 0;
  transition: width 0.6s cubic-bezier(.25,.8,.25,1);
  position: relative;
}

.progress-over::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 0;
  height: 100%;
  width: 6px;
  background: linear-gradient(to right,
            rgba(255,255,255,0) 0%,
            rgba(255,255,255,0.9) 50%,
            rgba(255,255,255,0) 100%);
  filter: blur(4px);
  pointer-events: none;
}

.chips{display:flex; flex-wrap:wrap; gap:.5rem}
.chip{
  background:var(--chip); border:1px solid #c7d2fe; color:#3730a3;
  padding:.25rem .6rem; border-radius:999px; font-size:.85rem; font-weight:600
}
.chip--success{background:#ecfdf5; border-color:#bbf7d0; color:#065f46}
.chip--warn{background:#fffbeb; border-color:#fde68a; color:#92400e}

.table-wrap {overflow-x: auto; background: none;}
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 0.5cm; 
  overflow: hidden;  
  box-shadow: 0 2px 8px rgba(164, 167, 173, 0.06);
}
th,td{padding:.65rem .6rem; border-bottom:1px solid var(--line); text-align:left; font-size:.95rem}
th{background: #f8fafc; color: var(--ink); font-weight: 600; text-align: left; border-bottom: 1px solid var(--line); padding: 0.75rem 1rem; position: relative;}
tbody tr:hover{background:#fafafa}

.badge{
  display:inline-flex; padding:.15rem .5rem; border-radius:999px; font-size:.8rem; font-weight:700; white-space: nowrap; line-height: 1; vertical-align: middle;
}
.badge--danger{background:#fee2e2; color:#991b1b}
.badge--ok{background:#dcfce7; color:#065f46}
.badge--warn{background:#fef3c7; color:#92400e}

.legend{display:flex; align-items:center; gap:.8rem; color:var(--muted); font-size:.9rem;}
.dot{display:inline-block; width:10px; height:10px; border-radius:999px}
.dot--danger{background:var(--danger)}
.dot--warn{background:var(--warn)}
.dot--ok{background:var(--ok)}

a {text-decoration: none; color: #0b64d8;}

th {
  background: #f8fafc;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0.75rem;
}

td {
  padding: 0.75rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

tbody tr:not(.row--danger):not(.row--warn):not(.row--paid):nth-child(even) {
  background: #ffffff;
}

tbody tr:last-child td {
  border-bottom: none;
}

.top-banner {
  display: block;
  text-align: center;
  height: auto;
  margin-bottom: 1rem;
  margin: 0 auto;
  padding-bottom: 0.5cm;
}

button {
  background: var(--brand);
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-right: 4px;
}
button:hover {
  background: #094fb1;
}

h3 {
  margin-top: 6px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  margin-bottom: 1em;
}

input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

input:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  background: #f9fafc;
}

input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 100, 216, 0.15);
  background: #fff;
}

input:disabled,
input[readonly] {
  background: #f4f6fb;
  color: var(--muted);
  border-color: var(--line);
  cursor: not-allowed;
  opacity: 0.7;
}

input {
  transition: all 0.25s ease;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100px;            
  height: 26px;            
  padding: 0 0.5rem;       
  font-size: 0.85rem;
  font-weight: 600;
  border: 2px solid currentColor;
  border-radius: 999px;
  text-align: center;
  white-space: nowrap; 
  text-overflow: ellipsis; 
  overflow: hidden;
  background: transparent;
  transition: all 0.2s ease;
}

.status--paid {
  color: var(--ok);     
}

.status--pending {
  color: var(--warn);     
}

.status--overdue {
  color: var(--danger);    
}

.status--other {
  color: var(--muted);  
}

.status:hover {
  background: color-mix(in srgb, currentColor 10%, transparent);
}

.status.long {
  font-size: 0.65rem;
}

tbody tr {
  transition: background 0.25s ease, border-color 0.25s ease;
}

.row--danger {
  background: #fff5f5;
  border-left: 4px solid var(--danger);
}

.row--warn {
  background: #fff9e6;
  border-left: 4px solid var(--warn);
}

.row--paid {
  background: #efffe6;
  border-left: 4px solid var(--ok);
}

tbody tr:hover {
  background: color-mix(in srgb, currentColor 4%, transparent);
  filter: brightness(0.98);
}

td.szamlaid {
  white-space: nowrap;
}

th.szamlaosszeg, td.szamlaosszeg {
  text-align: right;
}

.btn-solid {
  margin-right: 0.5em;
}

.globalmessage {
  background-color: #80c79250;
  border: 1px solid #80c79281;
  margin-bottom: 1em;
}

.customermessage {
  background: var(--note, #fff7ed);
  border-left: 3px solid #f59e0b;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.45;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.04);
  width: 100%;
  margin-top: 1.25rem;
  text-align: justify;
}

.customermessage strong {
  color: #b45309;
  font-weight: 700;
  margin-right: 6px;
}

.noinvoice {
  margin-left: 0.75em;
}

.search-error {
  color: #dc2626;
  font-size: 0.9rem;
  margin-top: 0.3rem;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  grid-column: span 2;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.06);
}

.stat-card.wide {
  grid-column: span 3;
}

@media (max-width: 550px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .stat-card,
  .stat-card.wide {
    grid-column: span 1;
  }
}

.stat-label {
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: .25rem;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
}

.outstanding {
  text-align: right;
  font-size: 1.5rem;
}

.lastcard {
  margin-bottom: 2em;
}

.card-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 0;
  list-style: none;
}

.card-summary::-webkit-details-marker {
  display: none;
}

.chevron {
  font-size: 1rem;
  transition: transform .25s ease;
}

details[open] .chevron {
  transform: rotate(180deg);
}

.card-content {
  margin-top: .6rem;
  animation: fadeIn .25s ease;
}

@keyframes fadeIn {
  from { opacity: .3; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

#backToTop {
  position: fixed;
  bottom: 24px;
  right: 24px;

  width: 48px;
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--brand);
  color: white;
  border: none;
  border-radius: 999px;
  cursor: pointer;

  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}

#backToTop.visible {
  opacity: 1;
  pointer-events: auto;
}

#backToTop i {
  font-size: 1.6rem;
  pointer-events: none;
  margin: 0;
}

.topimage {
  margin-top: 16px;
}

div.search {
  display: flex;
  align-items: baseline;
}

button.search {
  white-space: nowrap;
  height: 2.3em;
  margin-left: 1em;
}

.search-result {
  margin-top: .5rem;
  font-size: .95rem;
}
.search-result .result-link {
  margin-left: .4rem;
  font-weight: 600;
  color: var(--brand);
}
.search-result .result-link:hover {
  text-decoration: underline;
}

a.copy-btn {
  color: #ffffff;
}

.copy-btn {
  margin-left: .5rem;
  background: var(--brand);
  border: none;
  padding: .35rem .55rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  transition: background .2s;
}

.copy-btn:hover {
  background: #094fb1;
}

.copy-btn i {
  pointer-events: none;
}

.copy-btn.copied {
  background: var(--ok);
  color: white;
}

.wrappable {
  word-break: break-all;
  white-space: normal;
  display: block;
  line-height: 1.4;
  margin-top: .25rem;
}

.textinput {
  margin-top: 0.5em;
}

.right {
  text-align: right;
}

.grid-3.meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: flex-start;
}

.meta-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.value.danger {
  color: var(--danger);
  font-weight: 700;
}

.pricelist-link {
  margin-top: 1rem;
  font-size: .95rem;
}

.sumRow {
  font-weight: bold;
}

#tooltip-root .tooltip {
  position: absolute;
  background: #333;
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 14px;
  white-space: normal;
  max-width: 320px;
  word-wrap: break-word;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}
