:root {
  --ink: #17211f;
  --muted: #66736f;
  --line: #dfe7e4;
  --soft: #f2f6f4;
  --paper: #ffffff;
  --brand: #0b6b5b;
  --brand-dark: #075447;
  --brand-soft: #e5f4ef;
  --gold: #c18a2b;
  --danger: #b64141;
  --danger-soft: #fbeaea;
  --warning: #8b5b08;
  --warning-soft: #fff4d8;
  --shadow: 0 16px 50px rgba(17, 50, 43, .09);
  --radius: 18px;
  font-family: Tahoma, Arial, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f6f8f7;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: #f6f8f7; color: var(--ink); }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }

.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.narrow-content { width: min(760px, calc(100% - 40px)); }
.page-content { padding-block: 42px 64px; }

.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.topbar-inner { min-height: 68px; display: flex; align-items: center; gap: 26px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; white-space: nowrap; }
.brand-mark, .auth-icon { display: grid; place-items: center; background: var(--brand); color: white; font-weight: 900; letter-spacing: -.04em; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; font-size: 13px; }
.nav-links { display: flex; align-items: center; gap: 6px; flex: 1; }
.nav-links a { color: var(--muted); padding: 9px 13px; border-radius: 10px; font-size: 14px; font-weight: 700; }
.nav-links a:hover, .nav-links a.active { color: var(--brand); background: var(--brand-soft); }
.inline-form { margin: 0; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading h1 { margin: 3px 0 7px; font-size: clamp(27px, 4vw, 39px); letter-spacing: -.04em; }
.page-heading p { margin: 0; color: var(--muted); line-height: 1.7; }
.eyebrow { color: var(--brand) !important; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.back-link { display: inline-block; color: var(--brand); font-weight: 800; font-size: 14px; margin-bottom: 10px; }

.button { border: 0; border-radius: 12px; padding: 12px 19px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; font-weight: 800; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .65; cursor: wait; transform: none; }
.button-primary { background: var(--brand); color: white; box-shadow: 0 8px 20px rgba(11,107,91,.2); }
.button-primary:hover { background: var(--brand-dark); }
.button-secondary { background: var(--soft); color: var(--ink); border: 1px solid var(--line); }
.button-success { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid #b8ded3; }
.button-danger-soft { background: var(--danger-soft); color: var(--danger); }
.button-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.button-full { width: 100%; }
.button-small { padding: 8px 13px; font-size: 13px; }
.button-tiny { padding: 6px 10px; font-size: 12px; }
.button-large { padding-block: 15px; }
.button-xl { min-height: 58px; font-size: 17px; margin-top: 7px; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.alert { padding: 14px 16px; border-radius: 12px; margin-bottom: 19px; line-height: 1.6; font-weight: 700; font-size: 14px; }
.alert-error { background: var(--danger-soft); border: 1px solid #f2c8c8; color: #8f2d2d; }
.alert-success { background: var(--brand-soft); border: 1px solid #b8ded3; color: var(--brand-dark); }
.alert-warning { background: var(--warning-soft); border: 1px solid #efdca9; color: var(--warning); }
.muted { color: var(--muted); line-height: 1.75; }

.auth-page { background: radial-gradient(circle at 15% 15%, #dff2ec 0, transparent 28%), radial-gradient(circle at 85% 90%, #eee5d4 0, transparent 30%), #f6f8f7; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(450px, 100%); background: rgba(255,255,255,.96); border: 1px solid white; padding: clamp(28px, 6vw, 44px); border-radius: 26px; box-shadow: 0 25px 80px rgba(13,54,46,.13); text-align: center; }
.compact-card { width: min(420px, 100%); }
.auth-icon { width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 18px; box-shadow: 0 10px 25px rgba(11,107,91,.24); }
.auth-card h1 { font-size: 30px; margin: 6px 0 4px; letter-spacing: -.04em; }
.auth-card > .muted { margin: 0 0 24px; }
.stack-form { display: grid; gap: 17px; margin-top: 22px; text-align: right; }
label > span, .field-label { display: block; font-weight: 800; font-size: 13px; margin-bottom: 8px; color: #35433f; }
input { width: 100%; border: 1px solid #cfdad6; background: white; color: var(--ink); padding: 13px 14px; border-radius: 11px; outline: 0; transition: border-color .15s, box-shadow .15s; }
input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(11,107,91,.11); }
input::placeholder { color: #a0aaa7; }
.subtle-link { display: inline-block; margin-top: 24px; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }

.staff-page { background: linear-gradient(180deg, #eaf4f1 0, #f8faf9 45%, #f6f8f7 100%); }
.staff-header { min-height: 64px; display: flex; align-items: center; justify-content: space-between; max-width: 760px; margin: 0 auto; padding: 0 22px; }
.staff-brand { font-size: 14px; font-weight: 900; color: #31413c; display: flex; align-items: center; gap: 8px; }
.brand-dot { width: 10px; height: 10px; background: var(--brand); border-radius: 50%; box-shadow: 0 0 0 5px rgba(11,107,91,.12); }
.text-button { border: 0; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; padding: 8px; }
.staff-main { min-height: calc(100vh - 64px); display: flex; align-items: flex-start; justify-content: center; padding: clamp(32px, 8vh, 76px) 18px 60px; }
.allocation-card { width: min(510px, 100%); background: white; border: 1px solid rgba(209,223,218,.9); padding: clamp(25px, 6vw, 42px); border-radius: 25px; box-shadow: 0 22px 65px rgba(13,54,46,.11); }
.allocation-card h1 { font-size: clamp(29px, 7vw, 40px); margin: 12px 0 6px; letter-spacing: -.045em; }
.allocation-card > .muted { margin: 0 0 26px; }
.step-badge { display: inline-block; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 6px 10px; font-weight: 900; font-size: 11px; }
.amount-form { display: grid; gap: 10px; }
.amount-form label { font-weight: 900; font-size: 14px; }
.money-input-wrap { position: relative; }
.money-input-wrap input { font-size: clamp(27px, 8vw, 38px); font-weight: 900; padding: 16px 18px 16px 62px; direction: ltr; text-align: left; letter-spacing: .01em; }
.money-input-wrap span { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--brand); font-size: 27px; font-weight: 900; }
.amount-form small, .account-form small { color: var(--muted); font-size: 12px; }
.privacy-note { margin: 21px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.privacy-note span { color: var(--brand); font-size: 9px; }

.result-card { text-align: center; }
.success-mark { margin: 0 auto 14px; width: 62px; height: 62px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); border-radius: 50%; font-size: 29px; font-weight: 900; }
.result-card h1 { color: var(--brand-dark); }
.copy-field { text-align: right; display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 16px; margin-top: 12px; background: var(--soft); border: 1px solid var(--line); border-radius: 14px; }
.copy-field > div { min-width: 0; }
.copy-field .field-label { color: var(--muted); margin-bottom: 5px; }
.copy-field strong { display: block; overflow-wrap: anywhere; }
.iban-copy-field strong { font-family: Consolas, monospace; letter-spacing: .04em; font-size: 14px; }
.copy-button { flex: 0 0 auto; border: 1px solid #b8ded3; color: var(--brand); background: white; padding: 9px 11px; border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 900; }
.copy-button.copied { color: white; background: var(--brand); }
.important-note { background: var(--warning-soft); color: var(--warning); padding: 12px 14px; border-radius: 11px; font-size: 12px; line-height: 1.65; margin: 18px 0; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 38px; }
.summary-card { border: 1px solid var(--line); border-radius: 16px; background: white; padding: 20px; box-shadow: 0 8px 24px rgba(17,50,43,.05); }
.summary-card > span { color: var(--muted); font-size: 13px; font-weight: 700; }
.summary-card strong { display: block; font-size: 27px; margin: 7px 0 5px; letter-spacing: -.03em; }
.summary-card small { color: var(--muted); }
.accent-summary { background: var(--brand); color: white; border-color: var(--brand); }
.accent-summary > span, .accent-summary small { color: #c6e4dc; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 17px; }
.section-heading h2 { margin: 0 0 5px; font-size: 21px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.accounts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.account-card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 21px; box-shadow: 0 9px 30px rgba(17,50,43,.055); position: relative; overflow: hidden; }
.account-card::before { content: ''; height: 4px; position: absolute; inset: 0 0 auto; background: var(--brand); }
.account-card.status-paused::before { background: #8d9995; }
.account-card.status-limit_reached::before { background: var(--danger); }
.account-card-head { display: flex; justify-content: space-between; align-items: start; gap: 15px; }
.account-card h3 { margin: 10px 0 5px; font-size: 20px; }
.account-card code { color: var(--muted); font-size: 12px; }
.icon-button { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); font-size: 18px; }
.icon-button:hover { color: var(--brand); background: var(--brand-soft); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 8px; font-size: 10px; font-weight: 900; background: var(--soft); color: var(--muted); }
.status-pill span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-pill-active { background: var(--brand-soft); color: var(--brand); }
.status-pill-limit_reached { background: var(--danger-soft); color: var(--danger); }
.minimum-row { display: flex; justify-content: space-between; align-items: center; background: #f8faf9; border-radius: 10px; margin: 18px 0; padding: 10px 12px; font-size: 12px; color: var(--muted); }
.minimum-row strong { color: var(--ink); }
.meter-group { margin-top: 17px; }
.meter-label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; }
.meter-label > span { color: var(--muted); font-weight: 800; }
.meter-label strong { font-size: 12px; direction: ltr; }
.meter-label small { color: var(--muted); font-weight: 400; }
.progress { height: 7px; background: #edf1f0; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress span { height: 100%; display: block; border-radius: inherit; background: var(--brand); min-width: 0; }
.total-meter .progress span { background: var(--gold); }
.remaining { color: var(--muted); font-size: 10px; margin-top: 5px; }
.account-actions { border-top: 1px solid var(--line); margin-top: 19px; padding-top: 16px; }
.activate-form { display: grid; gap: 9px; }
.check-row { display: flex; align-items: center; gap: 8px; color: var(--danger); font-size: 12px; font-weight: 800; }
.check-row input { width: auto; accent-color: var(--brand); }
.reset-details { margin-top: 11px; color: var(--muted); font-size: 12px; }
.reset-details summary { cursor: pointer; text-align: center; font-weight: 800; padding: 4px; }
.reset-buttons { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.reset-buttons form { flex: 1; }
.reset-buttons button { width: 100%; }
.reset-details p { margin: 8px 0 0; text-align: center; font-size: 10px; }

.empty-state { text-align: center; padding: 58px 22px; }
.empty-icon { margin: 0 auto; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 17px; background: var(--brand-soft); color: var(--brand); font-size: 26px; }
.empty-state h2 { margin: 14px 0 5px; }
.empty-state p { color: var(--muted); margin: 0 0 20px; }
.small-empty { box-shadow: none; border: 0; }
.settings-panel { margin-top: 35px; padding: 25px; display: flex; align-items: center; justify-content: space-between; gap: 35px; }
.settings-panel h2 { margin: 5px 0; }
.settings-panel p { margin: 0; color: var(--muted); font-size: 13px; }
.settings-form { display: flex; align-items: end; gap: 10px; min-width: min(100%, 430px); }
.settings-form label { flex: 1; }

.form-panel { padding: clamp(22px, 5vw, 34px); }
.account-form { display: grid; gap: 26px; }
.form-grid { display: grid; gap: 18px; }
.two-columns { grid-template-columns: repeat(2, 1fr); }
.span-2 { grid-column: span 2; }
.suffix-input { position: relative; }
.suffix-input input { padding-left: 45px; direction: ltr; text-align: left; }
.suffix-input b { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--brand); }
.form-actions { display: flex; gap: 10px; border-top: 1px solid var(--line); padding-top: 22px; }

.table-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: right; white-space: nowrap; }
th { color: var(--muted); font-size: 11px; background: #f8faf9; }
th, td { padding: 15px 18px; border-bottom: 1px solid var(--line); }
td { font-size: 13px; }
td code { font-size: 11px; }
tbody tr:hover { background: #fbfdfc; }
.pagination { padding: 17px; display: flex; justify-content: center; align-items: center; gap: 15px; color: var(--muted); font-size: 12px; }
.error-mark { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 17px; background: var(--danger-soft); color: var(--danger); border-radius: 50%; font-size: 29px; font-weight: 900; }

@media (max-width: 800px) {
  .shell, .narrow-content { width: min(100% - 28px, 100%); }
  .topbar-inner { gap: 10px; min-height: 62px; }
  .brand > span:last-child { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .nav-links { gap: 0; overflow-x: auto; }
  .nav-links a { font-size: 12px; padding: 8px 9px; }
  .page-content { padding-block: 28px 50px; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-heading .button { width: 100%; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-card:last-child { grid-column: span 2; }
  .accounts-grid { grid-template-columns: 1fr; }
  .settings-panel { align-items: stretch; flex-direction: column; }
  .settings-form { min-width: 0; }
}

@media (max-width: 520px) {
  .auth-wrap { padding: 15px; }
  .auth-card { border-radius: 20px; padding: 27px 20px; }
  .staff-main { padding: 25px 13px 45px; }
  .allocation-card { padding: 26px 19px; border-radius: 20px; }
  .copy-field { align-items: stretch; flex-direction: column; }
  .copy-button { align-self: flex-start; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .summary-card { padding: 15px; }
  .summary-card strong { font-size: 21px; }
  .two-columns { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .form-actions, .settings-form { flex-direction: column; align-items: stretch; }
  .form-actions .button { width: 100%; }
  .account-card { padding: 18px 15px; }
  .nav-links a:nth-child(3) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
