/* gamyklos.lt admin area. MUNDITA palette: navy #0F1B2D, cyan #00C4F0, red #E0454A, green #1E9E5A.
   Served from /_s/<hash>/admin.css under CSP style-src 'self': no inline styles anywhere, system fonts only. */

:root {
  --navy: #0F1B2D;
  --navy-2: #18283F;
  --navy-3: #22344F;
  --cyan: #00C4F0;
  --cyan-strong: #0093C0;
  --cyan-text: #0070A0;
  --cyan-soft: #E6F8FD;
  --red: #E0454A;
  --red-text: #B3262C;
  --red-soft: #FDEEEF;
  --green: #1E9E5A;
  --green-text: #157A44;
  --green-soft: #E7F5EE;
  --amber: #B7791F;
  --amber-soft: #FDF5E6;
  --bg: #F2F4F8;
  --surface: #FFFFFF;
  --sunken: #EEF2F7;
  --line: #DDE3EB;
  --line-strong: #C5CEDA;
  --ink: #0F1B2D;
  --fg: #1C2738;
  --muted: #5A677B;
  --focus: #0093C0;
  --radius: 10px;
  --radius-small: 6px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 4px 16px rgba(15, 27, 45, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--font);
}

a { color: var(--cyan-text); text-underline-offset: 2px; }
a:hover { color: var(--cyan-strong); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.55rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .8em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }

/* !important throughout: it must win over the input[type=…] rules (higher specificity) below. */
.visually-hidden {
  position: absolute !important;
  width: 1px !important; height: 1px !important; min-height: 0 !important;
  margin: -1px !important; padding: 0 !important; border: 0 !important;
  overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important;
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.25rem;
  padding: .6rem 1.25rem;
  background: var(--navy);
  color: #E8EEF6;
  border-bottom: 3px solid var(--cyan);
}

.brand { display: inline-flex; align-items: center; gap: .55rem; color: #FFFFFF; text-decoration: none; }
.brand:hover { color: #FFFFFF; }
.brand-logo { display: block; width: 28px; height: 28px; }
.brand-name { font-weight: 700; font-size: 1.05rem; letter-spacing: .01em; }
.brand-sub { color: #9FB0C6; font-size: .85rem; }

.nav { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1 1 auto; }
.nav-link {
  color: #C8D3E1;
  text-decoration: none;
  padding: .35rem .7rem;
  border-radius: 999px;
  font-size: .92rem;
}
.nav-link:hover { color: #FFFFFF; background: var(--navy-3); }
.nav-link.is-active { color: var(--navy); background: var(--cyan); font-weight: 600; }

.userbox { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.userbox-name { color: #E8EEF6; text-decoration: none; font-size: .92rem; }
.userbox-name:hover { color: #FFFFFF; text-decoration: underline; }
.inline-form { display: inline; margin: 0; }

/* ---------- Page ---------- */

.page { width: 100%; max-width: 1120px; margin: 0 auto; padding: 1.5rem 1.25rem 2.5rem; flex: 1 0 auto; }
.page-wide { max-width: 1480px; }
.is-auth .page, .is-message .page { padding-top: 3rem; }

.foot { padding: .9rem 1.25rem; color: var(--muted); font-size: .8rem; text-align: center; border-top: 1px solid var(--line); background: var(--surface); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
}
.card-narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.auth-card h1 { margin-bottom: .9rem; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; align-items: start; }

.lead { font-size: 1.05rem; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); background: var(--sunken); border-radius: var(--radius); }

.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }

/* ---------- Alerts ---------- */

.alert { border-radius: var(--radius-small); padding: .7rem .9rem; margin: 0 0 1rem; border: 1px solid; }
.alert ul { margin: 0; padding-left: 1.2rem; }
.alert-ok { background: var(--green-soft); border-color: #A9DEC4; color: var(--green-text); }
.alert-error { background: var(--red-soft); border-color: #F3B9BC; color: var(--red-text); }
.alert-warn { background: var(--amber-soft); border-color: #F0D49B; color: #7A4F10; }
.alert-info { background: var(--cyan-soft); border-color: #A8E4F5; color: var(--cyan-text); }

/* ---------- Forms ---------- */

.form { display: grid; gap: .9rem; }
.field { display: grid; gap: .3rem; }
.field label, .label { font-weight: 600; color: var(--ink); font-size: .92rem; }
.field .help { color: var(--muted); font-size: .82rem; }
.hint { color: var(--muted); font-size: .85rem; }
.rules { margin: .3rem 0 0; padding-left: 1.2rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"],
input[type="search"], select, textarea {
  width: 100%;
  min-height: 2.5rem;
  padding: .5rem .65rem;
  font: inherit;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
}
textarea { min-height: 5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 2px solid rgba(0, 147, 192, .25); outline-offset: 0; }
input[readonly] { background: var(--sunken); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: normal; }
.check input { width: 1.05rem; height: 1.05rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-small); padding: .7rem .9rem; margin: 0; }
legend { font-weight: 600; padding: 0 .3rem; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin-bottom: 1rem; }
.filters .field { min-width: 150px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 2.5rem;
  padding: .5rem 1rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  cursor: pointer;
  background: var(--sunken);
  color: var(--ink);
}
.btn:hover { filter: brightness(.97); }
.btn:disabled, .btn.is-busy { opacity: .65; cursor: progress; }
.btn-primary { background: var(--cyan); color: var(--navy); border-color: var(--cyan-strong); }
.btn-primary:hover { background: #2BD0F5; color: var(--navy); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--sunken); color: var(--ink); }
.btn-danger { background: var(--red); color: #FFFFFF; border-color: #C93439; }
.btn-danger:hover { background: #C93439; color: #FFFFFF; }
.btn-success { background: var(--green); color: #FFFFFF; border-color: #187E48; }
.btn-ghost { background: transparent; color: #E8EEF6; border-color: rgba(200, 211, 225, .35); }
.btn-ghost:hover { background: var(--navy-3); color: #FFFFFF; }
.btn-small { min-height: 2rem; padding: .3rem .7rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--cyan-text); text-decoration: underline; font-weight: normal; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .55rem .75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { background: var(--sunken); color: var(--ink); font-weight: 650; white-space: nowrap; }
.table tbody tr:hover { background: #F8FBFE; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--ink); }

/* ---------- Chips and badges ---------- */

.chip { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 650; border: 1px solid; white-space: nowrap; }
.chip-draft { background: var(--amber-soft); color: #7A4F10; border-color: #F0D49B; }
.chip-final { background: var(--green-soft); color: var(--green-text); border-color: #A9DEC4; }
.chip-cancelled { background: var(--red-soft); color: var(--red-text); border-color: #F3B9BC; }
.chip-neutral { background: var(--sunken); color: var(--muted); border-color: var(--line); }
.chip-admin { background: var(--navy); color: #FFFFFF; border-color: var(--navy); }
.chip-viewer { background: var(--cyan-soft); color: var(--cyan-text); border-color: #A8E4F5; }

.meter { display: inline-block; width: 80px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; vertical-align: middle; }
.meter > span { display: block; height: 100%; background: var(--cyan); }

/* ---------- Pagination ---------- */

.pager { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 1rem 0; }
.pager a, .pager span { padding: .3rem .65rem; border-radius: var(--radius-small); border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.pager .is-current { background: var(--navy); color: #FFFFFF; border-color: var(--navy); }

/* ---------- Shift detail ---------- */

.pdf-frame { display: block; width: 100%; height: 80vh; min-height: 480px; border: 1px solid var(--line); border-radius: var(--radius); background: #FFFFFF; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
.photo-grid figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-small); overflow: hidden; }
.photo-grid img { display: block; width: 100%; height: 140px; object-fit: cover; background: var(--sunken); }
.photo-grid figcaption { padding: .35rem .5rem; font-size: .8rem; color: var(--muted); }
.is-cancelled { opacity: .7; }

/* ---------- One-time link box ---------- */

.linkbox { display: flex; gap: .5rem; align-items: stretch; }
.linkbox input { font-family: var(--mono); font-size: .85rem; }
.copy-done { color: var(--green-text); font-size: .85rem; }

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .topbar { padding: .55rem .8rem; }
  .page { padding: 1rem .8rem 2rem; }
  .card { padding: 1rem; }
  .userbox { margin-left: 0; width: 100%; justify-content: space-between; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { margin-top: .4rem; }
}

@media print {
  .topbar, .foot, .actions, .filters, .pager { display: none; }
  body { background: #FFFFFF; }
  .card { box-shadow: none; }
}
