@font-face { font-family: Manrope; src: url(/fonts/Manrope-greek.woff2) format('woff2'); font-weight: 200 800; font-display: swap; unicode-range: U+0370-03FF, U+1F00-1FFF; }
@font-face { font-family: Manrope; src: url(/fonts/Manrope-latin.woff2) format('woff2'); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
:root { --navy: #272043; --ink: #1c1838; --muted: #5f5a78; --line: #e4e1ee; --soft: #f6f5fa; --accent: #4b3bb8; --ok: #17693a; --okbg: #e3f4e9; --warn: #8a5a00; --warnbg: #fff1d6; --bad: #b3261e; --badbg: #fde7e5; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--soft); color: var(--ink); font: 15px/1.45 Manrope, 'Segoe UI', Arial, sans-serif; }
[hidden] { display: none !important; }
h1 { font-size: 21px; margin: 0 0 12px; }
h2 { font-size: 16px; margin: 0 0 10px; }
a { color: var(--accent); }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; background: var(--navy); color: #fff; padding: 8px 14px; }
.top-logo { height: 22px; }
.top-acc { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.env { background: #ffd666; color: #3d2c00; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; }
.tabs { display: flex; gap: 4px; align-items: center; }
.tabs a, .tabs button { color: #fff; text-decoration: none; background: none; border: 0; font: inherit; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.tabs a.on { background: rgba(255, 255, 255, .18); font-weight: 700; }
@media (max-width: 620px) { .tabs { width: 100%; justify-content: space-between; } }

main { max-width: 900px; margin: 0 auto; padding: 14px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); min-width: 0; }
input, select, textarea { display: block; width: 100%; margin-top: 3px; font: inherit; color: var(--ink); background: #fff; border: 1px solid #c9c5da; border-radius: 8px; padding: 9px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[type=checkbox] { display: inline-block; width: auto; margin: 0 6px 0 0; }
textarea { min-height: 70px; resize: vertical; }
.btn { display: inline-block; font: inherit; font-weight: 700; background: var(--accent); color: #fff; border: 0; border-radius: 9px; padding: 10px 16px; cursor: pointer; text-decoration: none; text-align: center; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: #fff; color: var(--accent); border: 1px solid #c9c5da; }
.btn.danger { background: var(--bad); }
.btn.small { padding: 6px 10px; font-size: 13px; font-weight: 600; }
.btn.big { width: 100%; font-size: 17px; padding: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.note { color: var(--muted); font-size: 13px; }
.msg { border-radius: 9px; padding: 9px 12px; margin: 8px 0; font-weight: 600; }
.msg.bad { background: var(--badbg); color: var(--bad); }
.msg.ok { background: var(--okbg); color: var(--ok); }
.msg.warn { background: var(--warnbg); color: var(--warn); }

.login { max-width: 360px; margin: 9vh auto 0; }
.login img { display: block; height: 30px; margin: 0 auto 16px; }

.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: #eceaf4; color: var(--muted); white-space: nowrap; }
.chip.issued { background: var(--okbg); color: var(--ok); }
.chip.attention, .chip.waiting_terminal, .chip.processing { background: var(--warnbg); color: var(--warn); }
.chip.failed, .chip.cancelled { background: var(--badbg); color: var(--bad); }

.docs { display: grid; gap: 8px; }
.doc { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: inherit; }
.doc b { font-size: 15px; }
.doc .amt { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc .sub { color: var(--muted); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.line { display: grid; grid-template-columns: minmax(0, 3fr) 70px 90px 80px 104px 34px; gap: 8px; align-items: end; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pay { display: grid; grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr) 34px; gap: 8px; align-items: end; margin-bottom: 8px; }
.x { width: 34px; height: 38px; border: 1px solid #c9c5da; background: #fff; border-radius: 8px; color: var(--bad); font: inherit; font-weight: 800; cursor: pointer; padding: 0; }
@media (max-width: 620px) {
  .line { grid-template-columns: 1fr 1fr 1fr; }
  .line .l-name { grid-column: 1 / -1; }
  .line .x { justify-self: end; }
  .pay { grid-template-columns: minmax(0, 1fr) 110px 34px; }
  .pay .p-ref { grid-column: 1 / -1; grid-row: 2; }
}
.tot { display: flex; justify-content: flex-end; gap: 18px; flex-wrap: wrap; font-variant-numeric: tabular-nums; margin-top: 8px; }
.tot b { font-size: 19px; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 12px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.qr { width: 120px; height: 120px; }
.qr svg { width: 100%; height: 100%; display: block; }
.items { width: 100%; border-collapse: collapse; }
.items td, .items th { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.items .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--warn); border-right-color: transparent; border-radius: 50%; animation: s 1s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes s { to { transform: rotate(360deg); } }

dialog { border: 0; border-radius: 14px; padding: 18px; width: min(440px, calc(100vw - 24px)); box-shadow: 0 12px 40px rgba(20, 15, 50, .3); }
dialog::backdrop { background: rgba(20, 15, 50, .45); }
.steps { padding-left: 20px; margin: 6px 0 10px; font-size: 14px; }
.totp-qr { width: min(240px, 100%); margin: 0 auto 6px; }
.totp-qr svg { width: 100%; height: auto; display: block; }
.key { font-family: Consolas, monospace; font-size: 13px; word-break: break-all; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.list { display: grid; gap: 6px; margin: 10px 0; }
.item { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; }
.item > span { min-width: 0; overflow-wrap: anywhere; }
