/* Osilanda apskaita: išvaizda */
:root {
  --blue: #2f45c5;
  --blue-d: #2533a8;
  --blue-l: #e8ecfd;
  --ink: #1d2433;
  --muted: #6b7385;
  --line: #e6e8ef;
  --bg: #f3f4f8;
  --card: #fff;
  --orange: #f29b1d;
  --red: #e5484d;
  --green: #2f9e6a;
  --radius: 12px;
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #fff; }
body { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.boot { min-height: 100vh; display: grid; place-items: center; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: rot .8s linear infinite; }
.boot .spin, .spin.dark { border-color: #d5d9ea; border-top-color: var(--blue); }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- Pagrindinis: viršutinė juosta ---------- */
.hero {
  position: relative;
  background: linear-gradient(115deg, #2a14a0 0%, #2d3cc6 45%, #2f55d4 75%, #2b7ce0 100%);
  color: #fff;
  padding: 14px 12px 40px;
  padding-top: max(14px, env(safe-area-inset-top));
}
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hello small { display: block; font-size: 11px; font-weight: 600; opacity: .95; }
.hello h2 { margin: 2px 0 0; font-size: 18px; font-weight: 600; }
.hero-btns { display: flex; gap: 8px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 18px; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
}
.pill svg { width: 16px; height: 16px; }
.bell { position: relative; width: 36px; padding: 0; justify-content: center; }
.bell .badge {
  position: absolute; right: -2px; bottom: -4px; min-width: 16px; height: 16px; border-radius: 8px;
  background: #e5484d; color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px;
}
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.stat-big {
  position: relative; overflow: hidden; border-radius: 10px; text-align: center; padding: 14px 8px 16px;
  background: rgba(255,255,255,.14);
}
.stat-big::before, .stat-big::after {
  content: ""; position: absolute; inset: auto -10% -60% -10%; height: 140%;
  background: radial-gradient(60% 50% at 30% 0%, rgba(255,255,255,.12), transparent 70%);
  border-radius: 50%;
}
.stat-big::after { inset: -70% -20% auto 30%; background: radial-gradient(50% 50% at 50% 100%, rgba(255,255,255,.10), transparent 70%); }
.stat-big p { margin: 0; font-size: 13px; font-weight: 500; display: inline-flex; gap: 5px; align-items: center; position: relative; }
.stat-big p svg { width: 14px; height: 14px; color: #ffc94a; }
.stat-big h2 { margin: 4px 0 0; font-size: 30px; font-weight: 600; position: relative; }
.stats-small { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.stat-sm { background: rgba(255,255,255,.14); border-radius: 10px; padding: 10px 10px 12px; min-height: 62px; }
.stat-sm p { margin: 0; font-size: 13px; font-weight: 500; display: flex; gap: 5px; align-items: center; }
.stat-sm p svg { width: 14px; height: 14px; color: var(--orange); }
.stat-sm h4 { margin: 8px 0 0; font-size: 15px; font-weight: 600; }
.running {
  margin-top: 8px; background: rgba(255,255,255,.95); color: var(--ink); border-radius: 10px; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px; font-size: 14px;
}
.running .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(47,158,106,.18); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(47,158,106,.05); } }
.running b { font-variant-numeric: tabular-nums; }
.running a { margin-left: auto; color: var(--blue); font-weight: 600; }

.sheet-main { position: relative; background: #fff; margin-top: -22px; border-radius: 26px 26px 0 0; padding: 22px 12px 24px; min-height: 50vh; }

/* Dienų juosta */
.days { display: flex; justify-content: space-between; gap: 4px; padding: 0 4%; margin-bottom: 22px; overflow: hidden; }
.day { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; min-width: 52px; }
.day .c {
  width: 58px; height: 58px; border-radius: 50%; border: 2px solid #e1e3ea; display: grid; place-items: center; align-content: center;
  background: #fff; line-height: 1;
}
.day .c small { font-size: 9px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.day .c b { font-size: 20px; font-weight: 600; margin-top: 3px; }
.day.has .c { background: #5b78f0; border-color: #5b78f0; color: #fff; box-shadow: 0 6px 14px rgba(70,100,240,.35); }
.day.has .c small { color: #fff; }
.day.today .c { background: #4a63ea; border-color: #4a63ea; color: #fff; box-shadow: 0 6px 16px rgba(70,100,240,.45); }
.day.today .c small { color: #fff; }
.day .t { font-size: 9px; font-weight: 700; letter-spacing: .6px; color: #4a63ea; height: 10px; }

/* Meniu kortelės */
.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mcard {
  background: #fff; border: 1px solid var(--line); border-radius: 10px; min-height: 128px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  font-size: 16px; font-weight: 500; color: #333a48; cursor: pointer; text-align: center; padding: 10px;
  transition: box-shadow .15s, transform .15s;
}
.mcard:hover { box-shadow: 0 6px 20px rgba(30,40,90,.07); }
.mcard:active { transform: scale(.98); }
.mcard .ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; }
.mcard .ic svg { width: 24px; height: 24px; color: #2b2f3a; }
.mcard .cnt { font-size: 12px; color: #fff; background: var(--red); border-radius: 9px; padding: 1px 7px; margin-left: 4px; }

/* ---------- Vidiniai puslapiai ---------- */
.page { min-height: 100vh; background: var(--bg); }
.pbar {
  position: sticky; top: 0; z-index: 5; background: #fff; display: flex; align-items: center; gap: 12px;
  padding: 14px 14px; padding-top: max(14px, env(safe-area-inset-top)); border-bottom: 1px solid #eef0f4;
}
.pbar h1 { margin: 0; font-size: 19px; font-weight: 600; }
.back { width: 32px; height: 32px; border: 0; background: none; padding: 0; cursor: pointer; display: grid; place-items: center; }
.back svg { width: 22px; height: 22px; }
.prog { flex: 1; height: 6px; background: #e4e6f5; border-radius: 3px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--blue); border-radius: 3px; transition: width .3s; }
.prog-n { font-size: 12px; color: var(--blue-d); }
.pbody { padding: 14px; max-width: 1600px; margin: 0 auto; }
.step-title { text-align: center; font-size: 22px; font-weight: 700; margin: 8px 0 12px; }

.box { background: #fff; border-radius: 6px; padding: 18px; margin-bottom: 18px; }
.box h3 { margin: 0 0 12px; font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.box h3 svg { width: 18px; height: 18px; color: var(--orange); }

.geo {
  border-radius: 10px; padding: 6px; background: #fff; box-shadow: 0 4px 16px rgba(90,70,200,.12);
}
.geo > div {
  height: 200px; border-radius: 6px; border: 1px solid rgba(255,255,255,.7);
  background: linear-gradient(90deg, #f3c9fb, #ddc6fb 40%, #c2b9fb 70%, #adb4fd);
  display: grid; place-items: center; text-align: center; color: #3b2f86; font-size: 14px; padding: 10px;
}
.geo .big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.addr { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; margin: 14px 0; }
.addr svg { width: 18px; height: 18px; color: var(--red); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 22px;
  border-radius: 4px; border: 1px solid var(--blue); background: var(--blue); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: #fff; color: var(--blue-d); }
.btn.red { background: var(--red); border-color: var(--red); }
.btn.green { background: var(--green); border-color: var(--green); }
.btn.sm { min-height: 30px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; min-height: 44px; font-size: 15px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.search {
  display: flex; align-items: center; background: #fff; border-radius: 4px; border: 1px solid #eceef3; margin: 16px 0;
}
.search input { flex: 1; border: 0; outline: 0; padding: 10px 16px; font-size: 16px; background: transparent; }
.search svg { width: 22px; height: 22px; margin-right: 10px; color: #555; }
.lbl { font-weight: 700; font-size: 15px; margin: 8px 0 4px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

.plist { display: grid; gap: 16px; }
.pitem {
  display: flex; align-items: center; gap: 10px; background: #f8f8fa; border-left: 4px solid #a9b4ee;
  border-radius: 4px; padding: 10px 14px 10px 8px; min-height: 56px; cursor: pointer; border-top: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left;
}
.pitem:hover { background: #f1f3fb; }
.pitem.sel { border-left-color: var(--blue); background: var(--blue-l); }
.pitem .no { width: 36px; height: 36px; border-radius: 8px; border: 1px solid #e6e7ec; background: #fff; display: grid; place-items: center; font-size: 12px; color: var(--muted); flex: none; }
.pitem .nm { flex: 1; font-size: 16px; color: #5a6070; font-weight: 500; }
.pitem .nm small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.pitem .pin { width: 20px; height: 20px; color: #8e9be8; flex: none; }
.pitem .dist { font-size: 12px; color: var(--muted); }

/* Formos */
.form { display: grid; gap: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid #dcdfe8; border-radius: 6px; padding: 10px 12px; font-size: 16px; background: #fff; outline: 0;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47,69,197,.12); }
.field textarea { min-height: 70px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; padding: 8px 0; border-bottom: 1px solid #f0f1f5; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--blue); }
.err { color: var(--red); font-size: 14px; min-height: 18px; }
.date-in { display: flex; align-items: center; gap: 8px; border: 1px solid #dcdfe8; border-radius: 4px; padding: 0 10px; max-width: 420px; background: #fff; }
.date-in svg { width: 18px; height: 18px; color: var(--orange); flex: none; }
.date-in input { border: 0; outline: 0; padding: 9px 0; font-size: 14px; min-width: 0; flex: 1; background: transparent; }

/* Valandų santrauka ir skirtukai */
.sum { display: flex; gap: 16px 60px; flex-wrap: wrap; }
.sum div { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.sum .i { width: 30px; height: 30px; border-radius: 50%; background: #e7f0fb; display: grid; place-items: center; }
.sum .i.v { background: #efe7fb; }
.sum .i svg { width: 16px; height: 16px; }
.tabs { display: flex; border: 1px solid #dcdfe8; border-radius: 22px; padding: 4px; background: #fff; }
.tabs button { flex: 1; border: 0; background: none; border-radius: 18px; padding: 9px 10px; font-weight: 600; font-size: 14px; cursor: pointer; }
.tabs button.on { background: var(--blue); color: #fff; }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.tbl th { background: #f4f5f9; text-align: left; font-weight: 500; color: #3b4150; padding: 14px 12px; font-size: 14px; }
.tbl th:first-child { border-radius: 6px 0 0 0; } .tbl th:last-child { border-radius: 0 6px 0 0; }
.tbl td { padding: 12px; vertical-align: middle; color: #3b4150; border-bottom: 1px solid #f0f1f5; }
.tbl tr:nth-child(even) td { background: #f5f8fe; }
.tbl td small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.tbl .act { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn { width: 32px; height: 32px; border-radius: 6px; border: 1px solid #e1e4ee; background: #fff; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.del svg { color: var(--red); }
.foot { font-size: 13px; padding: 12px 0; color: #333; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: #eef0f6; color: #4a5162; }
.tag.ok { background: #e2f5ec; color: #1f7a50; }
.tag.wait { background: #fff2d9; color: #9a6400; }
.tag.no { background: #fde6e7; color: #b42b30; }
.tag.run { background: #e2f5ec; color: #1f7a50; }

/* Sąrašų eilutės (įrankiai, darbuotojai ir kt.) */
.rows { display: grid; gap: 10px; }
.row { background: #fff; border-radius: 8px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; border: 1px solid #eceef3; }
.row .main { flex: 1; min-width: 0; }
.row .main b { display: block; font-weight: 600; font-size: 15px; }
.row .main small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.row .ri { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #fbefdc; }
.row .ri svg { width: 20px; height: 20px; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty input { width: 64px; border: 1px solid #dcdfe8; border-radius: 6px; padding: 6px; text-align: center; font-size: 15px; }

/* Apatinis lapas (meniu) */
.sheet-bg { position: fixed; inset: 0; background: rgba(15,20,40,.45); z-index: 40; animation: fade .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: #fff; border-radius: 0;
  max-height: 85vh; overflow-y: auto; padding: 8px 0 max(10px, env(safe-area-inset-bottom)); animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.sheet-inner { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.sheet h3 { margin: 10px 0; font-size: 17px; }
.sheet .opt {
  display: flex; align-items: center; gap: 16px; padding: 16px 4px; border-bottom: 1px solid #f0f1f5; font-size: 17px; font-weight: 500; cursor: pointer; width: 100%;
  background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left;
}
.sheet .opt:last-child { border-bottom: 0; }
.sheet .opt svg.l { width: 24px; height: 24px; color: var(--orange); flex: none; }
.sheet .opt svg.r { width: 18px; height: 18px; color: var(--orange); margin-left: auto; flex: none; }
.note-item { padding: 12px 4px; border-bottom: 1px solid #f0f1f5; font-size: 15px; }
.note-item small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.note-item.new { font-weight: 600; }

/* Kalendorius */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head b { font-size: 17px; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .wd { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; text-transform: uppercase; }
.cal .cd { background: #fff; border-radius: 6px; min-height: 74px; padding: 5px; font-size: 12px; cursor: pointer; border: 1px solid #eceef3; overflow: hidden; }
.cal .cd.out { opacity: .4; }
.cal .cd.today { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.cal .cd.sel { background: var(--blue-l); }
.cal .cd .n { font-weight: 600; font-size: 13px; }
.cal .ev { display: block; margin-top: 2px; padding: 1px 4px; border-radius: 3px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #e6ebff; color: #2b3aa0; }
.cal .ev.h { background: #ffe9dc; color: #a24b12; }
.cal .ev.s { background: #fff3cf; color: #8b6a00; }
.cal .ev.done { text-decoration: line-through; opacity: .6; }

/* Prisijungimas */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(115deg, #2a14a0 0%, #2d3cc6 45%, #2f55d4 75%, #2b7ce0 100%); }
.auth-card { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; padding: 28px 24px; box-shadow: 0 20px 50px rgba(10,10,60,.3); }
.auth-card .logo { width: 56px; height: 56px; margin: 0 auto 10px; display: block; }
.auth-card h1 { text-align: center; margin: 0 0 4px; font-size: 22px; }
.auth-card p { text-align: center; color: var(--muted); margin: 0 0 20px; font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: #1d2433; color: #fff;
  padding: 10px 18px; border-radius: 8px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 90vw; text-align: center;
}
.toast.bad { background: var(--red); }

@media (max-width: 700px) {
  .stats-small { grid-template-columns: repeat(3, 1fr); }
  .stat-big h2 { font-size: 26px; }
  .menu { gap: 10px; }
  .mcard { min-height: 112px; font-size: 15px; }
  .day .c { width: 48px; height: 48px; }
  .day .c b { font-size: 17px; }
  .days { padding: 0; }
  .pill .lbl-hide { display: none; }
  .cal .cd { min-height: 56px; }
  .grid2 { grid-template-columns: 1fr; }
}

/* GPS ribos */
.geo-ok { margin: 0; color: var(--green); font-size: 14px; font-weight: 500; }
.geo-bad { background: #fde6e7; color: #9b2227; border-radius: 6px; padding: 10px 12px; font-size: 14px; line-height: 1.45; }
.cnt-l { display: block; text-align: right; font-size: 12px; color: var(--red); margin-top: 4px; }
.cnt-l.ok { color: var(--green); }
.geo-cell { font-size: 13px; white-space: nowrap; }
.geo-cell + .geo-cell { margin-top: 4px; }
.geo-cell.bad { color: var(--red); font-weight: 600; white-space: normal; max-width: 220px; }
.geo-cell.bad small { color: #9b2227; font-weight: 400; }

/* Pakvietimai */
.invite-text { background: var(--bg); border-radius: 8px; padding: 12px 14px; font-size: 14px; line-height: 1.5; word-break: break-word; border: 1px solid var(--line); }
a.btn.block { text-align: center; }

/* Atostogų likučiai */
.neg { color: var(--red) !important; }
.pos { color: var(--green); }
.vac-big { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.vac-big b { font-size: 34px; font-weight: 700; color: var(--blue-d); }
.vac-big span { color: var(--muted); font-size: 14px; }
.vac-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.vac-grid div { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.vac-grid small { display: block; color: var(--muted); font-size: 12px; }
.vac-grid b { display: block; font-size: 16px; margin-top: 3px; }
.vac-calc { background: var(--blue-l); color: #2b3aa0; border-radius: 6px; padding: 10px 12px; font-size: 14px; line-height: 1.5; }
.box-in { background: #fafbfd; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-top: 12px; }
.vac-row { display: flex; align-items: center; gap: 12px; }
.vac-row > span:first-child { min-width: 70px; font-weight: 700; }
.vac-row .t { flex: 1; }
.vac-row.muted { opacity: .55; }
a.stat-sm { color: #fff; }
@media (max-width: 700px) { .vac-grid { grid-template-columns: 1fr 1fr; } .stats-small { grid-template-columns: 1fr 1fr; } }
