/* ==========================================================================
   Garantiniai – programos stilius (šviesi tema)
   Pagrindinė spalva keičiama nustatymuose (--accent).
   ========================================================================== */

:root {
	--accent: #2563eb;
	--accent-soft: color-mix(in srgb, var(--accent) 10%, #fff);
	--accent-line: color-mix(in srgb, var(--accent) 28%, #fff);
	--accent-dark: color-mix(in srgb, var(--accent) 82%, #000);

	--bg: #f5f7fb;
	--surface: #ffffff;
	--surface-2: #f9fafc;
	--line: #e5e9f0;
	--line-strong: #d4dae4;
	--text: #1d2433;
	--text-2: #4b5567;
	--muted: #7b8496;

	--green: #059669; --green-bg: #ecfdf5; --green-line: #a7f3d0;
	--orange: #c2410c; --orange-bg: #fff7ed; --orange-line: #fed7aa;
	--amber: #b45309; --amber-bg: #fffbeb; --amber-line: #fde68a;
	--red: #dc2626; --red-bg: #fef2f2; --red-line: #fecaca;
	--blue: #2563eb; --blue-bg: #eff6ff; --blue-line: #bfdbfe;
	--violet: #7c3aed; --violet-bg: #f5f3ff; --violet-line: #ddd6fe;
	--teal: #0d9488; --teal-bg: #f0fdfa; --teal-line: #99f6e4;
	--gray: #4b5563; --gray-bg: #f3f4f6; --gray-line: #e5e7eb;

	--radius: 12px;
	--radius-sm: 8px;
	--shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
	--shadow-lg: 0 20px 50px -12px rgba(16, 24, 40, .25);
	--sidebar: 256px;
	--topbar: 60px;
	--font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font: 15px/1.5 var(--font);
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
[hidden] { display: none !important; }
.ico { flex: none; display: block; }
.muted { color: var(--muted); font-size: 13px; }
.link { font-size: 14px; font-weight: 500; }
.hint { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }

/* ---------- Karkasas ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
	position: fixed; inset: 0 auto 0 0; z-index: 40;
	width: var(--sidebar);
	display: flex; flex-direction: column;
	background: var(--surface);
	border-right: 1px solid var(--line);
	padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; color: var(--text); text-decoration: none !important; }
.brand__logo { max-height: 36px; max-width: 170px; object-fit: contain; }
.brand__mark {
	display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
	background: var(--accent); color: #fff; flex: none;
}
.brand__mark--lg { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 14px; }
.brand__name { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; }
.sidebar .sidebar__close { display: none; position: absolute; top: 14px; right: 10px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav__sep { margin: 16px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav__item {
	display: flex; align-items: center; gap: 12px;
	padding: 10px 12px; border-radius: var(--radius-sm);
	color: var(--text-2); font-weight: 500; font-size: 14.5px;
	text-decoration: none !important; position: relative;
}
.nav__item:hover { background: var(--surface-2); color: var(--text); }
.nav__item.is-active { background: var(--accent-soft); color: var(--accent-dark); }
.nav__item.is-active .ico { color: var(--accent); }
.nav__count {
	margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
	background: var(--orange-bg); color: var(--orange); border: 1px solid var(--orange-line);
	font-size: 12px; font-weight: 700; display: inline-grid; place-items: center;
}
.nav__count.is-late { background: var(--red); color: #fff; border-color: var(--red); }

.sidebar__user {
	display: flex; align-items: center; gap: 10px;
	padding: 12px 8px 4px; margin-top: 12px; border-top: 1px solid var(--line);
}
.sidebar__user-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sidebar__user-info small { color: var(--muted); font-size: 11.5px; }
.sidebar__user-info strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
	width: 34px; height: 34px; border-radius: 50%; flex: none;
	display: grid; place-items: center; font-weight: 700; font-size: 14px;
	background: var(--accent-soft); color: var(--accent-dark);
}
.sidebar-backdrop { display: none; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar); display: flex; flex-direction: column; }
.topbar {
	position: sticky; top: 0; z-index: 30;
	height: var(--topbar); display: flex; align-items: center; gap: 12px;
	padding: 0 28px; background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid transparent;
}
.topbar .topbar__menu, .topbar .topbar__title { display: none; }
.sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar__user { font-size: 13.5px; color: var(--text-2); }
.bell { position: relative; }
.bell__count {
	position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px;
	border-radius: 9px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700;
	display: grid; place-items: center; border: 2px solid var(--bg);
}
.bell__count.is-late { background: var(--red); }

.content { padding: 8px 28px 48px; max-width: 1480px; width: 100%; }

.bottom-nav { display: none; }

/* ---------- Mygtukai ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
	border: 1px solid transparent; background: var(--surface-2); color: var(--text);
	font: 500 14px/1 var(--font); cursor: pointer; white-space: nowrap;
	text-decoration: none !important; transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
	outline: none; box-shadow: 0 0 0 3px var(--accent-line);
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); }
.btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--red); color: #fff; }
.btn--danger:hover { background: #b91c1c; }
.btn--link { background: none; color: var(--accent); padding: 0 6px; }
.btn--danger-text { color: var(--red); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn--lg { height: 48px; font-size: 15.5px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .6; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.icon-btn {
	display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
	border-radius: var(--radius-sm); border: 0; background: transparent; color: var(--text-2);
	cursor: pointer; text-decoration: none !important;
}
.icon-btn:hover { background: var(--gray-bg); color: var(--text); }
.icon-btn--danger:hover { background: var(--red-bg); color: var(--red); }

/* ---------- Puslapio antraštė ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 20px; }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Kortelės ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card__head h2 { font-size: 16px; font-weight: 650; }
.card__body { padding: 0; }
.card__body.grid, .card__body > p, .card__body > .btn-row, .card__body.logo-row { padding: 18px 20px; }
.card__body > p { margin: 0; padding-bottom: 0; color: var(--text-2); }

.alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.alert--info { background: var(--blue-bg); border-color: var(--blue-line); color: #1e40af; }
.alert--danger { background: var(--red-bg); border-color: var(--red-line); color: #991b1b; }

/* ---------- Statistika ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
	display: flex; flex-direction: column; gap: 6px; padding: 18px 20px;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: var(--shadow); color: inherit; text-decoration: none !important;
}
a.stat:hover { border-color: var(--accent-line); }
.stat__label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat__value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat__note { font-size: 12.5px; color: var(--muted); }
.stat--warn .stat__value { color: var(--orange); }
.stat--danger .stat__note { color: var(--red); font-weight: 600; }
.stat.is-loading .stat__value, .stat.is-loading .stat__label { background: var(--gray-bg); border-radius: 6px; color: transparent; }

/* ---------- Įrankių juosta ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar__hint { margin: 0; font-size: 13px; color: var(--muted); }
.toolbar__filters-toggle { display: none; }
.search {
	flex: 1 1 360px; display: flex; align-items: center; gap: 10px;
	height: 44px; padding: 0 14px; background: var(--surface);
	border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--muted);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-line); }
.search input { border: 0; outline: 0; background: none; font: inherit; color: var(--text); width: 100%; height: 100%; }
.filters { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------- Formos ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field small { font-size: 12px; color: var(--muted); }
.field--inline { gap: 4px; }
.field--inline > span { font-size: 12px; }
.field--wide { grid-column: span 2; }
.field--full { grid-column: 1 / -1; }
input[type="text"], input[type="search"], input[type="email"], input[type="tel"], input[type="number"],
input[type="date"], input[type="password"], input:not([type]), select, textarea {
	width: 100%; min-height: 42px; padding: 9px 12px;
	font: 15px/1.4 var(--font); color: var(--text);
	background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
	transition: border-color .15s, box-shadow .15s;
}
.search input { min-height: 0; padding: 0; border: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-line); }
textarea { resize: vertical; min-height: 70px; }
select { appearance: none; padding-right: 34px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8496' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.filters select, .filters input { min-height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; }
input[type="color"] { width: 100%; height: 42px; padding: 4px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.grid { display: grid; gap: 14px 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.fs { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.fs legend { padding: 0; margin-bottom: 12px; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }

/* ---------- Lentelės (mobiliai tampa kortelėmis) ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
	text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
	color: var(--muted); padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; transition: background .1s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tr.is-late { background: var(--red-bg); }
.tbl tr.is-late:hover { background: #fde8e8; }
.tbl tr.is-late td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.tbl .nr { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.tbl .nowrap { white-space: nowrap; }
.tbl .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .actions { white-space: nowrap; text-align: right; width: 1%; }
.tbl .actions-in { display: inline-flex; gap: 2px; align-items: center; }
.only-m { display: none !important; }
.list-plain li.is-late { background: var(--red-bg); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 6px; }
.empty .ico { margin: 0 auto 10px; color: var(--line-strong); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.pager__btns { display: flex; gap: 6px; }

/* ---------- Ženkleliai ---------- */
.badge {
	display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
	border-radius: 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--plain::before { display: none; }
.badge--blue { color: var(--blue); background: var(--blue-bg); border-color: var(--blue-line); }
.badge--violet { color: var(--violet); background: var(--violet-bg); border-color: var(--violet-line); }
.badge--orange { color: var(--orange); background: var(--orange-bg); border-color: var(--orange-line); }
.badge--teal { color: var(--teal); background: var(--teal-bg); border-color: var(--teal-line); }
.badge--green { color: var(--green); background: var(--green-bg); border-color: var(--green-line); }
.badge--gray { color: var(--gray); background: var(--gray-bg); border-color: var(--gray-line); }
.badge--red { color: var(--red); background: var(--red-bg); border-color: var(--red-line); }
.badge--amber { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-line); }
.badge--solid-red { color: #fff; background: var(--red); border-color: var(--red); }
.badge--stiga { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }

.days { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-plain li > span:first-child { flex: 1; min-width: 0; }
.list-plain li > .days, .list-plain li > .badge { flex: none; }
.days--late { color: var(--red); }

/* ---------- Skirtukai ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; box-shadow: inset 0 -1px 0 var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab {
	display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px;
	border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer;
	font: 600 14.5px var(--font); color: var(--muted); white-space: nowrap;
}
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tab__count { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--gray-bg); color: var(--text-2); font-size: 12px; display: inline-grid; place-items: center; }
.tab__count:empty { display: none; }

/* ---------- Modalai ---------- */
.modal {
	position: fixed; inset: 0; z-index: 100; display: none;
	align-items: flex-start; justify-content: center; padding: 40px 16px;
	background: rgba(17, 24, 39, .45); overflow-y: auto;
}
.modal.is-open { display: flex; animation: fade .15s ease-out; }
.modal__dialog {
	width: 100%; max-width: 620px; background: var(--surface); border-radius: 16px;
	box-shadow: var(--shadow-lg); display: flex; flex-direction: column; margin: auto 0;
	animation: pop .18s ease-out;
}
.modal__dialog > form { display: flex; flex-direction: column; min-height: 0; }
.modal__dialog--lg { max-width: 920px; }
.modal__dialog--sm { max-width: 440px; }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 19px; font-weight: 700; }
.modal__head--warn { background: var(--orange-bg); border-radius: 16px 16px 0 0; border-bottom-color: var(--orange-line); }
.modal__sub { display: block; font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.modal__body { padding: 22px 24px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 16px 16px; flex-wrap: wrap; }
.modal__foot--split { justify-content: space-between; }
.modal__foot .grow { flex: 1; }
.modal--confirm .modal__body h2 { font-size: 18px; margin-bottom: 8px; }
.modal--confirm .modal__body p { margin: 0; color: var(--text-2); }
.modal--confirm { align-items: center; z-index: 120; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }

/* Garantijos likutis */
.gar-box { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14.5px; border: 1px solid; display: flex; gap: 10px; align-items: center; }
.gar-box:empty { display: none; }
.gar-box--galioja { background: var(--green-bg); color: var(--green); border-color: var(--green-line); }
.gar-box--baigiasi { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-line); }
.gar-box--pasibaigusi { background: var(--red-bg); color: var(--red); border-color: var(--red-line); }
.gar-box--nezinoma { background: var(--gray-bg); color: var(--gray); border-color: var(--gray-line); font-weight: 500; }
.gar-box__big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }

/* Peržiūra */
.view-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.view-sec { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.view-sec--full { grid-column: 1 / -1; }
.view-sec h3 { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.dl { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; margin: 0; font-size: 14px; color: var(--text); }
.view-sec .pre + h3 { margin-top: 14px; }

.timeline { display: flex; gap: 0; margin: 4px 0 0; padding: 0; list-style: none; }
.timeline li { flex: 1; position: relative; padding-top: 18px; font-size: 12.5px; color: var(--muted); text-align: center; }
.timeline li::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 2px; background: var(--line); }
.timeline li::after { content: ""; position: absolute; top: 0; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.timeline li.is-done { color: var(--text); }
.timeline li.is-done::before { background: var(--accent); }
.timeline li.is-done::after { background: var(--accent); border-color: var(--accent); }
.timeline li strong { display: block; font-size: 12.5px; }
.timeline li:first-child::before { left: 50%; }
.timeline li:last-child::before { right: 50%; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; }
.quick__label { font-size: 13px; color: var(--muted); margin-right: 4px; }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list-plain li:last-child { border-bottom: 0; }
.history li { display: block; }
.history time { color: var(--muted); font-size: 12.5px; margin-right: 8px; font-variant-numeric: tabular-nums; }
.meta-line { font-size: 12.5px; color: var(--muted); margin-top: 14px; }

/* Nuotraukos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 12px 0; }
.photos:empty { display: none; }
.photo { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--gray-bg); border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 15px; line-height: 1; }
.photo--new { outline: 2px dashed var(--accent-line); outline-offset: -2px; }
.upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; cursor: pointer; margin-top: 10px; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload__btn { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px dashed var(--accent-line); background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; font-size: 14px; }
.upload__info { font-size: 13px; color: var(--muted); }

/* Automatinis pildymas */
.ac { position: relative; }
.ac__list {
	position: absolute; top: 100%; left: 0; right: 0; z-index: 10; margin-top: 4px;
	background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
	box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto;
}
.ac__item { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; cursor: pointer; font: 14px var(--font); color: var(--text); border-bottom: 1px solid var(--line); }
.ac__item:last-child { border-bottom: 0; }
.ac__item:hover, .ac__item.is-active { background: var(--accent-soft); }
.ac__item small { display: block; color: var(--muted); font-size: 12.5px; }

.info-box { margin: -8px 0 22px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: 14px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.info-box strong { font-size: 15px; }

/* Remonto eiga */
.eiga { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.eiga:empty::before { content: "Įrašų dar nėra."; color: var(--muted); font-size: 13.5px; }
.eiga__row { display: grid; grid-template-columns: 150px 1fr auto; gap: 8px; align-items: start; }
.eiga__row textarea { min-height: 42px; }
.eiga-add { display: grid; grid-template-columns: 150px 1fr auto; gap: 8px; }

/* Nustatymai */
.logo-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.logo-preview { width: 240px; height: 90px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--surface-2); padding: 10px; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-actions { display: flex; gap: 10px; align-items: center; }
.sticky-save { position: sticky; bottom: 16px; z-index: 5; display: flex; justify-content: flex-end; margin: -6px 0 20px; }
.sticky-save .btn { box-shadow: var(--shadow-lg); }

/* Pranešimai */
.toasts { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; min-width: 240px; max-width: 380px; padding: 12px 16px; border-radius: 10px; background: #111827; color: #fff; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .2s ease-out; }
.toast--error { background: var(--red); }
.toast--ok { background: #065f46; }

.loader { height: 120px; display: grid; place-items: center; }
.loader::after { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Prisijungimas ---------- */
.login-page { background: radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login__card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 36px 32px 28px; }
.login__brand { text-align: center; margin-bottom: 24px; }
.login__brand h1 { font-size: 21px; font-weight: 700; margin-bottom: 4px; }
.login__logo { max-width: 200px; max-height: 70px; margin: 0 auto 14px; display: block; }
.login__form { display: flex; flex-direction: column; gap: 16px; }
.login__lost { display: block; text-align: center; margin-top: 18px; font-size: 13.5px; }
.pwd { position: relative; display: block; }
.pwd input { padding-right: 76px; }
.pwd__toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: var(--gray-bg); color: var(--text-2); font: 500 12.5px var(--font); cursor: pointer; }

/* ==========================================================================
   Mobilioji versija
   ========================================================================== */
@media (max-width: 1100px) {
	.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
	:root { --topbar: 56px; }
	body { font-size: 15px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
	body.login-page { padding-bottom: 0; }

	.sidebar { transform: translateX(-100%); transition: transform .22s ease; width: min(86vw, 300px); box-shadow: var(--shadow-lg); z-index: 90; }
	body.nav-open .sidebar { transform: none; }
	.sidebar .sidebar__close { display: inline-grid; }
	.sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 80; background: rgba(17,24,39,.4); opacity: 0; pointer-events: none; transition: opacity .2s; }
	body.nav-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
	body.nav-open { overflow: hidden; }

	.main { margin-left: 0; }
	.topbar { padding: 0 12px; background: var(--surface); border-bottom-color: var(--line); }
	.topbar .topbar__menu, .topbar .topbar__title { display: inline-grid; }
	.topbar__title { font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
	.topbar__user { display: none; }
	.topbar__right { gap: 4px; }

	.content { padding: 4px 14px 32px; }
	.page-head { margin: 14px 0 14px; }
	.page-title { font-size: 21px; }
	.page-actions { width: 100%; }
	.page-actions .btn { flex: 1; }
	#export-btn span { display: none; }
	#export-btn { flex: 0 0 auto; width: 44px; padding: 0; }

	.bottom-nav {
		display: grid; grid-template-columns: repeat(5, 1fr);
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
		background: var(--surface); border-top: 1px solid var(--line);
		padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
	}
	.bottom-nav__item {
		display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative;
		padding: 6px 2px; border: 0; background: none; color: var(--muted);
		font: 600 11px var(--font); text-decoration: none !important; cursor: pointer; border-radius: 10px;
	}
	.bottom-nav__item.is-active { color: var(--accent); }
	.bottom-nav__item .nav__count { position: absolute; top: 0; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; font-size: 10.5px; padding: 0 5px; }

	.toolbar__filters-toggle { display: inline-flex; height: 44px; }
	.filters { display: none; width: 100%; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
	.filters.is-open, .filters--open { display: grid; grid-template-columns: 1fr 1fr; }
	.filters--open { padding: 0; background: none; border: 0; }
	.filters .btn--link { grid-column: 1 / -1; }
	.search { flex-basis: 100%; order: -1; }
	.toolbar__filters-toggle ~ .search { flex-basis: auto; }

	/* Lentelė → kortelės */
	.tbl thead { display: none; }
	.tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
	.tbl tbody tr { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
	.tbl tbody tr:last-child { border-bottom: 0; }
	.tbl td { padding: 0; border: 0; grid-column: 1 / -1; font-size: 14px; }
	.tbl td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12.5px; }
	.tbl td.cell-main { grid-column: 1; font-size: 15px; }
	.tbl td.cell-main::before, .tbl td.cell-badge::before, .tbl td.actions::before { display: none; }
	.tbl td.cell-badge { grid-column: 2; grid-row: 1; text-align: right; }
	.tbl td.cell-hide-m { display: none; }
	.only-m { display: block !important; }
	.tbl .actions { width: auto; text-align: left; margin-top: 6px; }
	.tbl .actions-in { gap: 4px; }
	.tbl .actions .icon-btn { width: 40px; height: 40px; background: var(--surface-2); border: 1px solid var(--line); }
	.tbl tr.is-late td:first-child { box-shadow: none; }
	.tbl tr.is-late { box-shadow: inset 3px 0 0 var(--red); }

	.grid--2, .grid--3 { grid-template-columns: 1fr; }
	.field--wide { grid-column: auto; }
	.view-grid { grid-template-columns: 1fr; }

	.modal { padding: 0; align-items: stretch; }
	.modal__dialog, .modal__dialog--lg { max-width: none; min-height: 100%; border-radius: 0; margin: 0; }
	.modal__dialog > form { flex: 1; }
	.modal__head { position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 14px 16px; }
	.modal__head--warn { background: var(--orange-bg); border-radius: 0; }
	.modal__body { padding: 18px 16px; flex: 1; }
	.modal__foot { position: sticky; bottom: 0; border-radius: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
	.modal__foot .btn { flex: 1; height: 46px; }
	.modal--confirm { padding: 16px; align-items: center; }
	.modal--confirm .modal__dialog { min-height: 0; border-radius: 16px; }
	.modal--confirm .modal__foot { position: static; border-radius: 0 0 16px 16px; }

	input, select, textarea { font-size: 16px !important; } /* iOS nepriartina */
	.eiga__row, .eiga-add { grid-template-columns: 1fr; }
	.timeline li { font-size: 11px; }
	.toasts { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
	.toast { max-width: none; }
	.sticky-save { bottom: calc(76px + env(safe-area-inset-bottom)); }
	.sticky-save .btn { width: 100%; height: 48px; }
}

@media (max-width: 480px) {
	.stats { gap: 10px; }
	.stat { padding: 14px; }
	.stat__value { font-size: 26px; }
	.login__card { padding: 28px 20px 22px; }
}

@media print {
	.sidebar, .topbar, .bottom-nav, .page-actions, .toolbar { display: none !important; }
	.main { margin: 0; }
}
