:root {
  --navy: #1f3a6b;
  --navy-2: #2c4f8f;
  --sand: #c79a5b;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1d2433;
  --muted: #667085;
  --line: #e3e6ec;
  --ok: #1a7f4b;
  --ok-bg: #e7f6ee;
  --warn-bg: #fff6e5;
  --err: #b42318;
  --err-bg: #fdecea;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 Arial, Helvetica, sans-serif; }
button, input, select, textarea, table, .btn { font-family: inherit; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; }
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 18px 0 8px; }
a { color: var(--navy-2); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); font-weight: 600; }
.brand img { height: 30px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a, nav button { text-decoration: none; color: var(--text); padding: 6px 10px; border-radius: 8px; font: inherit; background: none; border: 0; cursor: pointer; }
nav a:hover, nav button:hover { background: var(--bg); }
nav a.active { background: #e9eef8; color: var(--navy); font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.narrow { max-width: 420px; margin: 40px auto; }
.login-logo { display: block; height: 44px; margin: 0 auto 18px; }

label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 4px; }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input, select, textarea { width: 100%; font: inherit; padding: 9px 11px; border: 1px solid #cfd4dc; border-radius: 8px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid #b9c8e6; border-color: var(--navy-2); }
textarea { min-height: 140px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--navy); background: var(--navy); color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--navy-2); }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn.secondary { background: #fff; color: var(--navy); }
.btn.secondary:hover { background: #eef2fa; }
.btn.danger { background: #fff; color: var(--err); border-color: #f1b8b2; }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.types { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.type { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; background: #fff; text-align: left; font: inherit; color: inherit; }
.type:hover { border-color: var(--navy-2); }
.type.selected { border-color: var(--navy); box-shadow: 0 0 0 2px #c9d5ee inset; background: #f6f8fd; }
.type b { display: block; color: var(--navy); }
.type span { font-size: .85rem; color: var(--muted); }

.notice { border-radius: 8px; padding: 10px 12px; margin: 12px 0; font-size: .92rem; }
.notice.ok { background: var(--ok-bg); color: #0f5132; }
.notice.warn { background: var(--warn-bg); color: #7a4a00; }
.notice.err { background: var(--err-bg); color: var(--err); }
.notice.info { background: #eef2fa; color: var(--navy); }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .02em; }
.table-wrap { overflow-x: auto; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .78rem; background: #eef0f4; color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.pending { background: var(--warn-bg); color: #7a4a00; }

.result { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; }
@media (max-width: 760px) { .result { grid-template-columns: 1fr; } }
.result iframe { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.steps { padding-left: 20px; margin: 8px 0; }
.steps li { margin: 4px 0; }
.pw { font-family: ui-monospace, Menlo, Consolas, monospace; background: #f2f4f7; padding: 2px 6px; border-radius: 6px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1d2433; color: #fff; padding: 10px 16px; border-radius: 8px; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 10; }
.toast.err { background: var(--err); }

/* Atostogų suvestinė */
.cal-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 12px; }
.cal-title { min-width: 150px; text-align: center; font-size: 1.05rem; }
.cal-card { padding: 0; overflow: hidden; }
.cal-card .table-wrap { overflow-x: auto; }
table.cal { border-collapse: separate; border-spacing: 0; font-size: .8rem; width: auto; min-width: 100%; }
table.cal th, table.cal td { border-bottom: 1px solid var(--line); border-right: 1px solid #eef0f4; padding: 0; text-align: center; vertical-align: middle; height: 34px; min-width: 25px; }
table.cal thead th { text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 600; padding: 4px 0; line-height: 1.1; }
table.cal thead th span { display: block; font-weight: 400; color: var(--muted); font-size: .7rem; }
table.cal .who { position: sticky; left: 0; background: #fff; z-index: 1; text-align: left; padding: 4px 10px; min-width: 150px; max-width: 190px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text); font-size: .85rem; border-right: 1px solid var(--line); }
table.cal .who span { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.cal tr.me .who { color: var(--navy); }
table.cal tr.grp th { text-align: left; padding: 8px 10px; background: #f6f8fd; color: var(--navy); font-size: .8rem; position: sticky; left: 0; }
table.cal .off, .legend i.off { background: #eceef2; }
table.cal thead th.today { box-shadow: inset 0 -3px 0 var(--sand); }
table.cal td.today:not([class*="t-"]) { background: #fbf4e8; }
table.cal tfoot th, table.cal tfoot td { font-weight: 600; color: var(--muted); border-bottom: 0; }
table.cal tfoot td.clash, .legend i.clash { background: #fdecea; color: var(--err); }
.t-kasmetines { background: #cfe0fb; color: #1f3a6b; }
.t-nemokamos { background: #e4dcf7; color: #4b2f8a; }
.t-mamadienis { background: #fbe2cf; color: #8a4a12; }
.t-gimtadienis { background: #d6f0df; color: #1a6b3d; }
.t-komandiruote { background: #fff1b8; color: #7a5b00; }
.t-nedirba { background: #f6d7a7; color: #7a4a00; }
table.cal td[class*="t-"] { font-weight: 700; cursor: default; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 0; font-size: .85rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 18px; border-radius: 4px; font-style: normal; font-weight: 700; font-size: .7rem; border: 1px solid rgba(0,0,0,.06); }

.card.export { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; }
.card.export label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.card.export input { width: auto; padding: 5px 8px; }

fieldset.vis { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 14px 0 4px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
fieldset.vis legend { font-weight: 600; font-size: .9rem; padding: 0 4px; }
fieldset.vis label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
fieldset.vis input { width: auto; }

/* --- Elektroninis pasirašymas --- */
@font-face { font-family: 'Great Vibes'; src: url('/fonts/GreatVibes-Regular.ttf') format('truetype'); font-display: swap; }
nav .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--err); color: #fff; font-size: .78rem; font-weight: 700; line-height: 20px; text-align: center; }
.notice.sign { background: #eef2fa; color: var(--navy); }
.card.hl { border-color: var(--navy-2); box-shadow: 0 0 0 2px #dbe4f5; }
.badge.err { background: var(--err-bg); color: var(--err); }
.err-t { color: var(--err); }
.signs { list-style: none; margin: 4px 0 0; padding: 0; }
.signs li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.signs li:last-child { border-bottom: 0; }
.signs .who, .signs .st { display: flex; flex-direction: column; }
.signs .st { align-items: flex-end; text-align: right; }
.sig { font-family: 'Great Vibes', cursive; font-size: 1.35rem; white-space: nowrap; line-height: 1.1; color: #1f3a6b; }
.signs li.s-pending .who b { color: var(--muted); }
.t-pending { background: #c9ced6 !important; color: #4b5563 !important; }
details.card summary { cursor: pointer; }
.signs .who { flex: 1; min-width: 0; }
