/* VL CMS admin. Veebilahenduste bränd: tumesinine, mündiroheline, hele lavendelhall taust. */
:root {
  --navy: #0f1a2a;
  --ink: #1b2533;
  --muted: #5b6271;
  --line: #e4e2ea;
  --line-strong: #cfccd8;
  --bg: #f4f2f7;
  --card: #fff;
  --mint: #18eb96;
  --mint-hover: #10d685;
  --mint-soft: #e2fbf0;
  --accent: #0b6b47;
  --ok: #12b76a;
  --warn: #e59a1a;
  --err: #d64545;
  --r: 16px;
  --r-sm: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 30px; font-weight: 700; margin: 0 0 20px; color: var(--navy); }
h2 { font-size: 18px; font-weight: 650; margin: 0 0 14px; color: var(--navy); }
h3 { font-size: 15px; font-weight: 650; margin: 22px 0 8px; color: var(--navy); }
p { margin: 0 0 12px; }
code, pre { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.big { font-size: 36px; font-weight: 700; line-height: 1.1; margin: 0 0 4px; color: var(--navy); }
.error { color: var(--err); }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }

/* ülemine riba */
.topbar { position: sticky; top: 0; z-index: 50; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--line); }
.tb-brand { display: flex; align-items: center; gap: 12px; color: var(--navy); font-weight: 700; font-size: 17px; }
.tb-brand:hover { text-decoration: none; }
.tb-right { display: flex; align-items: center; gap: 20px; }
.tb-right form { margin: 0; }
.tb-link { color: var(--ink); font-size: 14px; }
.tb-user { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; }
.tb-user:hover { text-decoration: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 13px; }

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: calc(100vh - 64px); }
.side { padding: 20px 14px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; display: flex; flex-direction: column; }
.nav-group { font-size: 13px; color: var(--muted); margin: 14px 12px 6px; }
.nav-group:first-child { margin-top: 0; }
.side nav ul { list-style: none; margin: 0; padding: 0; }
.side nav a { display: block; padding: 8px 12px; border-radius: var(--r-sm); color: var(--ink); font-size: 15px; }
.side nav a:hover { background: #ebe8f1; text-decoration: none; }
.side nav a[aria-current="page"] { background: #fff; color: var(--navy); font-weight: 650; box-shadow: 0 1px 2px rgba(15, 26, 42, .06); }
.side-foot { margin-top: auto; padding: 16px 12px 0; font-size: 12px; color: var(--muted); }
.side-foot a { color: var(--muted); }
.main { padding: 32px 40px 80px; max-width: 1240px; width: 100%; }

.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.crumbs { margin: 0 0 4px; font-size: 13px; }
.crumbs a { color: var(--muted); }

.card { background: var(--card); border-radius: var(--r); padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(15, 26, 42, .04); }
.card.narrow { max-width: 600px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid2 > .card, .grid3 > .card { margin-bottom: 0; }
.grid3 + .grid2 { margin-top: 20px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* töölaud */
.hello h1 { font-size: 34px; margin-bottom: 4px; }
.hello p { font-size: 17px; margin-bottom: 24px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.tile { background: #fff; border-radius: var(--r); padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; color: var(--navy); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 26, 42, .04); transition: box-shadow .15s, transform .15s; }
.tile svg { color: var(--navy); }
.tile:hover { text-decoration: none; box-shadow: 0 6px 20px rgba(15, 26, 42, .08); transform: translateY(-1px); }

/* nupud */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 600; min-height: 40px; padding: 0 20px; border: 1.5px solid var(--navy); border-radius: 40px; background: #fff; color: var(--navy); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn-primary { background: var(--mint); border-color: var(--mint); color: var(--navy); }
.btn-primary:hover { background: var(--mint-hover); border-color: var(--mint-hover); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-block { width: 100%; }
.btn-link { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.danger { color: var(--err); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 8px; }

/* vormid */
.field { margin-bottom: 18px; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 6px; color: var(--navy); }
.field-check label { font-weight: 400; display: flex; gap: 10px; align-items: center; color: var(--ink); }
.help { color: var(--muted); font-size: 13px; margin: -2px 0 8px; }
.req { color: var(--err); }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="date"], input[type="datetime-local"], select, textarea {
  width: 100%; font: inherit; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, .rt-area:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(24, 235, 150, .45); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--navy); }
label.check { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
input[type="file"] { font: inherit; }

/* olek */
.sq { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 8px; vertical-align: 1px; background: var(--muted); }
.sq-ok { background: var(--ok); }
.sq-warn { background: var(--warn); }
.sq-err { background: var(--err); }
.sq-muted { background: #c4c1cc; }
.flash { padding: 14px 18px; background: #fff; border-radius: var(--r-sm); margin-bottom: 16px; box-shadow: 0 1px 2px rgba(15, 26, 42, .05); }
.flash-ok .sq { background: var(--ok); }
.flash-error .sq { background: var(--err); }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 18px; background: #fff; border-radius: var(--r-sm); margin-bottom: 16px; box-shadow: 0 1px 2px rgba(15, 26, 42, .05); }

/* tabelid ja loendid */
.table { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 24px; background: #fff; border-radius: var(--r); overflow: hidden; box-shadow: 0 1px 2px rgba(15, 26, 42, .04); }
.table th { text-align: left; font-weight: 600; font-size: 13px; color: var(--muted); padding: 14px 18px; border-bottom: 1px solid var(--line); }
.table td { padding: 14px 18px; border-bottom: 1px solid #f0eef4; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #faf9fc; }
.table td a { color: var(--navy); font-weight: 550; }
.depth-1 { padding-left: 38px !important; } .depth-2 { padding-left: 58px !important; } .depth-3 { padding-left: 78px !important; } .depth-4 { padding-left: 98px !important; } .depth-5 { padding-left: 118px !important; }
h2.group { margin: 28px 0 12px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid #f0eef4; }
.list li:last-child { border-bottom: 0; }
.tabs { display: flex; gap: 6px; margin: 12px 0 20px; flex-wrap: wrap; }
.tabs a { padding: 8px 16px; color: var(--ink); border-radius: 40px; font-size: 14px; }
.tabs a:hover { background: #ebe8f1; text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--navy); color: #fff; }
form.inline { display: inline; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; flex: 1 1 180px; }

/* muutmisvaade */
.edit-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.edit-main { background: #fff; border-radius: var(--r); padding: 28px; box-shadow: 0 1px 2px rgba(15, 26, 42, .04); }
.edit-side { position: sticky; top: 88px; }
.edit-side .card { padding: 20px; }
.slug-row { display: flex; align-items: center; gap: 6px; }
.slug-row span { white-space: nowrap; font-size: 13px; }
.repeater { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px 18px; }
.repeater legend { padding: 0 6px; }
.rep-row { border-radius: var(--r-sm); padding: 14px 16px 2px; margin-bottom: 12px; background: var(--bg); }
.rep-tools { display: flex; gap: 12px; justify-content: flex-end; margin-bottom: 8px; font-size: 13px; }
.rep-tools button { font: inherit; font-size: 13px; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }
.rep-tools [data-remove] { color: var(--err); }
.rt { border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.rt-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: #faf9fc; }
.rt-bar button { font: inherit; font-size: 13px; padding: 4px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--ink); }
.rt-bar button:hover { background: #ebe8f1; }
.rt-area { min-height: 180px; padding: 12px 14px; background: #fff; }
.rt-area:focus { box-shadow: none; }
.rt:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(24, 235, 150, .45); }
.rt-area > :first-child { margin-top: 0; }
.rt-area h2 { font-size: 21px; } .rt-area h3 { font-size: 17px; }
.imgpick-prev { margin-bottom: 10px; }
.thumb { max-width: 180px; max-height: 130px; border-radius: var(--r-sm); display: block; }
.g-items { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.g-item { position: relative; }
.g-item button { position: absolute; top: 4px; right: 4px; border: 0; background: #fff; border-radius: 6px; cursor: pointer; }
.file-icon { display: inline-block; padding: 26px 18px; background: var(--bg); border-radius: var(--r-sm); font-size: 13px; color: var(--muted); }
details.seo { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 28px; }
details.seo summary { font-weight: 650; color: var(--navy); cursor: pointer; margin-bottom: 18px; }
.serp { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; margin-bottom: 18px; font-family: Arial, sans-serif; max-width: 640px; }
.serp-url { font-size: 13px; color: #202124; }
.serp-title { font-size: 19px; color: #1a0dab; line-height: 1.3; margin: 2px 0; }
.serp-desc { font-size: 14px; color: #4d5156; }
.count-bad { color: var(--warn); }

/* meedia */
.upload { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.upload .field { flex: 1 1 320px; margin: 0; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.media-item { background: #fff; border-radius: var(--r); padding: 12px; box-shadow: 0 1px 2px rgba(15, 26, 42, .04); }
.media-item input { min-height: 38px; padding: 8px 10px; }
.media-thumb { display: block; margin-bottom: 10px; }
.media-thumb .thumb { max-width: 100%; max-height: none; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.sticky-save { position: sticky; bottom: 0; background: var(--bg); padding: 14px 0; margin-top: 16px; }
.picker { border: 0; border-radius: var(--r); padding: 24px; width: min(920px, 92vw); max-height: 85vh; box-shadow: 0 20px 60px rgba(15, 26, 42, .25); }
.picker::backdrop { background: rgba(15, 26, 42, .4); }
.picker-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.picker-head h2 { margin: 0; }
.picker-upload { margin-bottom: 14px; display: flex; gap: 12px; align-items: center; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.picker-grid button { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px; background: #fff; cursor: pointer; text-align: left; font: inherit; font-size: 12px; color: var(--ink); }
.picker-grid button:hover { border-color: var(--navy); }
.picker-grid img { width: 100%; height: 92px; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 6px; }

/* menüüd */
.menu-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0eef4; }
.menu-row.is-child { padding-left: 32px; }
.menu-row .rep-tools { margin: 0; }

.sub summary { cursor: pointer; list-style: none; }
.sub summary::-webkit-details-marker { display: none; }
.sub-data { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; margin: 16px 0; }
.sub-data dt { color: var(--muted); }
.sub-data dd { margin: 0; }
.codes { background: var(--bg); padding: 18px; border-radius: var(--r-sm); font-size: 16px; line-height: 1.8; }
.secret { font-size: 15px; }
.qr svg { display: block; margin: 14px 0; border-radius: var(--r-sm); }

/* sisselogimine */
body.bare { background: var(--bg); }
.login { max-width: 400px; margin: 10vh auto 40px; padding: 0 16px; text-align: center; }
.login-logo { display: block; margin: 0 auto 18px; }
.login h1 { font-size: 26px; margin-bottom: 4px; }
.login-sub { color: var(--muted); margin-bottom: 24px; }
.login .card { padding: 28px; text-align: left; }
.login > p.small { margin-top: 18px; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding-bottom: 0; }
  .side nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .side nav ul { display: contents; }
  .nav-group, .side-foot { display: none; }
  .main { padding: 20px 16px 60px; }
  .edit-cols, .grid2, .grid3, .row2 { grid-template-columns: 1fr; }
  .edit-side { position: static; }
  .menu-row { grid-template-columns: 1fr; }
  .tb-name, .tb-link { display: none; }
}
.head-row { align-items: center; margin-bottom: 20px; }
.head-row h1 { margin: 0; }
.tb-right .btn-link { color: var(--ink); font-size: 14px; }
input[type="file"]::file-selector-button { font: inherit; font-size: 14px; font-weight: 600; min-height: 38px; padding: 0 18px; margin-right: 12px; border: 1.5px solid var(--navy); border-radius: 40px; background: #fff; color: var(--navy); cursor: pointer; }

/* tume külgmenüü (nagu veebilahendused.ee jalus) */
.side { background: var(--navy); }
.nav-group { color: #8d95a5; }
.side nav a { color: #e6e9ef; }
.side nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side nav a[aria-current="page"] { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: none; }
.side-foot, .side-foot a { color: #8d95a5; }
.side :focus-visible { outline-color: var(--mint); }

/* olekut näidatakse tekstiga, mitte värviruutudega */
.sq { display: none; }
.flash-error { color: var(--err); }
.state { color: var(--muted); font-size: 13px; }
.state-bad { color: var(--err); font-size: 13px; }
.field-section { font-size: 16px; margin: 32px 0 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.edit-main > .field-section:first-of-type { margin-top: 8px; }
.rt-inline .rt-area { min-height: 46px; }
