/* BookKeeping design kit - the same visual language as VaadBait (Shilgit family): light background, white cards with a thin
   border, the blue accent, the two-part login screen, rounded menu items.

   To try another palette (for example a greener one) change ONLY the tokens in :root below - every page reads them. */
:root {
  --bg: #f5f7f9;
  --card: #ffffff;
  --border: #d8e0e6;
  --text: #23313f;
  --muted: #647380;
  --accent: #3d6ea5;
  --accent-hover: #315a87;
  --accent-dark: #1f3a54;      /* end of the brand-panel gradient */
  --accent-soft: #f0f5fa;      /* hover background of menu items and rows */
  --brand-text: #bcd0e6;       /* tagline on the brand panel */
  --brand-desc: #dce8f5;
  --green: #7fa576;            /* the "trees" of the illustrations */
  --err: #8a2c25;  --err-bg: #fbe9e8;  --err-border: #e3b3af;
  --warn: #7a5a00; --warn-bg: #fff4d6; --warn-border: #e6cf8a;
  --ok: #1f5c33;
  /* aliases used by the working pages */
  --ink: var(--text);
  --line: var(--border);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Segoe UI", Tahoma, Arial, sans-serif; }
[hidden] { display: none !important; }

/* keeps the focus ring for keyboard users only (same rule as VaadBait) */
button:focus:not(:focus-visible) { outline: none; }

/* ---------- two-part entrance screen (login, Shilgit home) ---------- */
.split { display: flex; min-height: 100vh; }
.brand-panel {
  flex: 0 0 420px; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 48px;
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-dark) 100%);
}
.brand-mark { display: flex; align-items: center; gap: 10px; position: absolute; top: 32px; right: 48px; z-index: 2; }
.brand-mark span { color: #fff; font-size: 13px; letter-spacing: .3px; opacity: .85; }
.brand-copy { position: relative; z-index: 2; }
.brand-copy h2 { color: #fff; font-size: 32px; font-weight: 700; margin: 0 0 4px; }
.brand-copy .brand-tagline { color: var(--brand-text); font-size: 14px; margin-bottom: 14px; }
.brand-copy .brand-desc { color: var(--brand-desc); font-size: 15px; line-height: 1.7; max-width: 320px; }
.brand-dots { position: absolute; left: -50px; bottom: -50px; opacity: .16; }
.brand-skyline { position: absolute; left: 0; bottom: 0; width: 100%; height: auto; opacity: .22; }
.form-panel { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 32px 16px 16px; }
.form-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; width: 100%; }
.illustration { width: 240px; height: auto; }
.illustration .b1 { fill: var(--accent); }
.illustration .b2 { fill: var(--accent-hover); }
.illustration .leaf rect { fill: #8a7256; }
.illustration .leaf circle { fill: var(--green); }
.illustration .trend { stroke: var(--green); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.illustration .dot { fill: #fff; stroke: var(--green); stroke-width: 2.5; }
.illustration .ribbon { fill: var(--green); }
.illustration .gridline { stroke: #fff; stroke-width: 2; stroke-linecap: round; opacity: .55; }
.illustration .link { stroke: var(--accent); stroke-width: 2; opacity: .45; }
.illustration .code { stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
#cookieNotice { text-align: center; font-size: 11px; color: var(--muted); margin-top: 10px; max-width: 320px; line-height: 1.5; }
#cookieNotice a { color: var(--muted); text-decoration: underline; }
#cookieNotice a:hover { color: var(--accent); }
.modal-overlay { position: fixed; inset: 0; background: rgba(20,30,40,0.55); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 24px; }
.modal-panel { background: var(--card); border-radius: 10px; width: 100%; max-width: 900px; height: 88vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.modal-iframe { flex: 1 1 auto; border: none; width: 100%; }
@media (max-width: 900px) { .brand-panel { display: none; } }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 28px 32px; width: 100%; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.card.narrow { max-width: 360px; }
.card h1 { font-size: 19px; margin: 0 0 2px; text-align: center; }
.brand-sub { color: var(--muted); font-size: 12px; text-align: center; margin-bottom: 6px; }
.subtitle { color: var(--muted); font-size: 13px; margin-bottom: 20px; text-align: center; }
.contact { text-align: center; font-size: 13px; color: var(--muted); line-height: 1.8; }
.contact .name { font-weight: 600; color: var(--text); }
.contact a { color: var(--accent); text-decoration: none; display: block; }
.contact a:hover { text-decoration: underline; }

/* ---------- controls ---------- */
label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--muted); }
input, select { font-family: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.field input { width: 100%; margin-bottom: 14px; }
button, .btn { font-family: inherit; font-size: 14px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; }
button:hover:not(:disabled), .btn:hover { background: var(--bg); }
button.primary, .btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
button.primary:hover:not(:disabled), .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button:disabled { opacity: .55; cursor: default; }
.error { background: var(--err-bg); color: var(--err); border: 1px solid var(--err-border); border-radius: 6px; padding: 8px 12px; font-size: 13px; margin-bottom: 14px; text-align: center; display: none; }

/* big stacked choice buttons (Shilgit home) */
a.choice { display: block; padding: 16px 20px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); font-size: 18px; font-weight: 700;
           background: #fff; transition: border-color .15s, background .15s, box-shadow .15s; }
a.choice small { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; font-size: 13px; }
a.choice:hover { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 2px 10px rgba(61,110,165,.12); }
a.choice.disabled { color: var(--muted); background: #fafafa; border-style: dashed; cursor: default; box-shadow: none; }
a.choice + a.choice { margin-top: 12px; }

/* ---------- application pages ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--border); }
.topbar h1 { margin: 0; font-size: 17px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; }
.topbar .brand svg { flex: none; }
.topbar a { color: var(--accent); text-decoration: none; font-size: 13px; }
.topbar a:hover { text-decoration: underline; }
.page { max-width: 1250px; margin: 16px auto; padding: 0 14px 40px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.03); }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button { padding: 8px 16px; border-radius: 8px 8px 0 0; }
.tabs button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { border: 1px solid var(--border); padding: 5px 8px; text-align: right; vertical-align: top; }
th { background: #eef2f6; position: sticky; top: 0; }
tr:hover td { background: var(--accent-soft); }
td.num, td.n { text-align: left; direction: ltr; white-space: nowrap; }
.msg { min-height: 20px; margin: 8px 0; font-size: 14px; }
.msg.err, .err { color: var(--err); } .msg.ok, .ok { color: var(--ok); } .msg.warn, .warn { color: var(--warn); } .muted { color: var(--muted); }
.chip { display: inline-block; background: var(--accent-soft); border: 1px solid var(--border); border-radius: 10px; padding: 1px 8px; margin: 1px; font-size: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.scroll { overflow: auto; max-height: 600px; }

/* ---------- menu (centered card like VaadBait's main menu) ---------- */
body.menu-page { display: flex; justify-content: center; padding: 38px 16px; }
.menu-card { max-width: 500px; }
.illus-wrap { background: var(--bg); margin: -28px -32px 14px; padding: 16px 0 10px; border-radius: 10px 10px 0 0; }
.illus-wrap .illustration { display: block; width: 170px; margin: 0 auto; }
.switch-bar { text-align: center; margin: 0 -32px 16px; padding: 6px; background: #fff; }
.switch-bar select { font-size: 12px; padding: 4px 8px; }
a.menu-item { display: block; padding: 8px 16px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text); font-size: 14px; font-weight: 600; transition: border-color .15s, background .15s; }
a.menu-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.menu-item .desc { display: block; margin-top: 3px; color: var(--muted); font-weight: 400; font-size: 12px; }
.menu-item.soon { display: block; padding: 8px 16px; border: 1px dashed var(--border); border-radius: 8px; background: #fafafa; color: var(--muted); cursor: default; font-size: 14px; font-weight: 600; }
.menu-group { margin: 14px 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.menu-list { display: flex; flex-direction: column; gap: 7px; }
.menu-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; font-size: 12px; color: var(--muted); }
.menu-foot a { color: var(--muted); text-decoration: none; } .menu-foot a:hover { text-decoration: underline; }

/* ---------- password helpers (assets/pw.js): eye button + "i" tooltip, same look as the VaadBait login ---------- */
.label-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.label-row label { margin-bottom: 0; }
.field-wrap { position: relative; display: block; }
.field-wrap input { padding-left: 36px; }
td .field-wrap, .row .field-wrap { display: inline-block; }
.icon-btn { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); margin-top: -7px; width: 26px; height: 26px; padding: 0; border: none;
            background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 4px; }
.icon-btn:hover:not(:disabled) { color: var(--text); background: var(--bg); }
.icon-btn svg { width: 18px; height: 18px; }
td .field-wrap .icon-btn, .row .field-wrap .icon-btn { margin-top: 0; }
.info-wrap { position: relative; display: inline-flex; align-items: center; vertical-align: middle; }
.info-btn { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--muted); background: transparent; color: var(--muted); font-size: 11px; line-height: 1;
            cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }
.info-btn:hover:not(:disabled), .info-btn:focus { color: #fff; background: var(--muted); outline: none; }
.info-tooltip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 230px; background: var(--text); color: #fff;
                font-size: 12px; font-weight: 400; line-height: 1.5; padding: 8px 10px; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.15); text-align: right;
                opacity: 0; visibility: hidden; transition: opacity .15s ease; z-index: 20; }
.info-tooltip::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--text); }
.info-wrap.below .info-tooltip { bottom: auto; top: calc(100% + 8px); }
.info-wrap.below .info-tooltip::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--text); }
.info-wrap.open .info-tooltip, .info-wrap:hover .info-tooltip, .info-btn:focus + .info-tooltip { opacity: 1; visibility: visible; }
