/* dash.lowrain.lt – system fonts for speed; same palette as the site. */
:root {
  --moss-900: #12241A; --moss-700: #28483A; --moss-100: #E4EDDC; --paper: #F7F5EF; --white: #fff;
  --ink: #1A1F1C; --muted: #535E58; --line: #DCD6C8; --clay: #8A4F1C; --clay-700: #6F3E14;
  --ok-bg: #E3F0E6; --ok: #1F5A35; --warn-bg: #FBEFD9; --warn: #7A4C00; --err-bg: #FBE4E1; --err: #A1261B;
  --r: 12px; --shadow: 0 1px 2px rgba(18,36,26,.06), 0 6px 18px rgba(18,36,26,.06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 400 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--paper); }
a { color: var(--moss-700); }
:focus-visible { outline: 3px solid var(--clay); outline-offset: 2px; border-radius: 4px; }
h1 { font-size: 1.6rem; margin: 0 0 4px; line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
img { display: block; max-width: 100%; height: auto; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--moss-900); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 8px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .875rem; margin: 6px 0 0; }
.mt { margin-top: 32px; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--moss-900); color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 16px; }
.brand { color: #fff; text-decoration: none; font-weight: 800; letter-spacing: .08em; }
.brand span { font-weight: 400; letter-spacing: 0; opacity: .7; }
.top nav { order: 3; flex-basis: 100%; overflow-x: auto; }
.top nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.top nav a { display: flex; align-items: center; gap: 6px; padding: 10px 12px; color: #D9E4D2; text-decoration: none; border-radius: 8px; white-space: nowrap; min-height: 44px; font-weight: 600; font-size: .95rem; }
.top nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.top nav a[aria-current="page"] { background: #fff; color: var(--moss-900); }
.count { background: var(--clay); color: #fff; border-radius: 10px; padding: 0 7px; font-size: .75rem; line-height: 20px; }
.top-act { margin-left: auto; display: flex; gap: 8px; }
.top-act form { margin: 0; }
.top .btn-ghost { color: #fff; background: transparent; border-color: rgba(255,255,255,.4); }
.top .btn-ghost:hover { background: rgba(255,255,255,.1); }
@media (min-width: 1000px) { .top nav { order: 0; flex-basis: auto; } .top { padding: 8px 24px; } }
@media (max-width: 520px) { .top-act .btn span { display: none; } }

.main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 120px; }
.main-login { display: grid; place-items: center; min-height: 100vh; padding-bottom: 24px; }
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 20px; }
.back { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 600; margin-bottom: 12px; min-height: 44px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1.5px solid transparent; font: 700 .95rem/1.2 inherit; text-decoration: none; cursor: pointer; background: none; color: inherit; transition: background-color .15s, border-color .15s; touch-action: manipulation; }
.btn-primary { background: var(--clay); color: #fff; }
.btn-primary:hover { background: var(--clay-700); color: #fff; }
.btn-ghost { border-color: var(--line); background: var(--white); color: var(--ink); }
.btn-ghost:hover { border-color: var(--moss-700); }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger-ghost { color: var(--err); border-color: #E7B9B3; background: var(--white); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .875rem; }
.btn-lg { min-height: 52px; padding: 12px 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; border-color: var(--line); background: var(--white); }
.btn[disabled] { opacity: .5; cursor: progress; }

/* Flash */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-warn { background: var(--warn-bg); color: var(--warn); }
.flash-err { background: var(--err-bg); color: var(--err); }
.flash ul { margin: 6px 0 0; padding-left: 20px; font-weight: 400; }
.flash a { color: inherit; }

/* Forms */
.field { margin-bottom: 14px; }
.field > label, fieldset > legend { display: block; font-weight: 700; margin-bottom: 6px; font-size: .95rem; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #BDB5A3; border-radius: 10px; background: var(--white); font: inherit; color: inherit; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(138,79,28,.3); border-color: var(--clay); }
[aria-invalid="true"] { border-color: var(--err) !important; }
.err { color: var(--err); font-weight: 600; font-size: .875rem; margin: 6px 0 0; }
.req { color: var(--err); }
fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.radio, .check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 10px 0; cursor: pointer; }
.radio input, .check input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; accent-color: var(--moss-700); }
.checks { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.grid2, .grid3 { display: grid; gap: 0 20px; }
@media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } }
.prefix { display: flex; align-items: stretch; }
.prefix span { display: flex; align-items: center; padding: 0 10px; background: var(--moss-100); border: 1px solid #BDB5A3; border-right: 0; border-radius: 10px 0 0 10px; font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; max-width: 50%; }
.prefix input { border-radius: 0 10px 10px 0 !important; }
.pw { display: flex; gap: 8px; }
.stack { display: grid; gap: 16px; list-style: none; padding: 0; margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row form { margin: 0; }
.end { justify-content: flex-end; grid-column: 1 / -1; }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel.danger { border-color: #EBCFCB; }

/* Login */
.login { width: min(400px, 100%); background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 32px 24px; box-shadow: var(--shadow); }
.login h1 { font-size: 1.3rem; letter-spacing: .08em; margin-bottom: 20px; }
.login h1 span { font-weight: 400; letter-spacing: 0; color: var(--muted); }

/* Filters & list */
.filters { display: grid; gap: 0 12px; align-items: end; margin-bottom: 16px; }
@media (min-width: 760px) { .filters { grid-template-columns: 2fr 1fr 1fr auto; } .filters .btn { margin-bottom: 14px; } }
.plist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.prow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px 8px 8px; }
.prow.is-draft { background: #F3F1EC; }
.prow.is-draft strong { color: var(--muted); }
.prow-main { display: flex; align-items: center; gap: 14px; flex: 1 1 300px; min-width: 0; text-decoration: none; color: inherit; min-height: 72px; }
.prow-main:hover strong { text-decoration: underline; }
.thumb { width: 72px; height: 72px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.noimg { font-size: .65rem; text-align: center; color: var(--muted); padding: 4px; }
.prow-text { display: flex; flex-direction: column; min-width: 0; }
.prow-text strong { font-size: 1rem; }
.prow-text .muted { font-size: .875rem; overflow-wrap: anywhere; }
.prow-tags { display: flex; gap: 8px; }
.prow-tags form { margin: 0; }
.pill { display: inline-flex; align-items: center; min-height: 36px; padding: 4px 14px; border-radius: 999px; font: 700 .8rem/1 inherit; border: 1.5px solid transparent; cursor: pointer; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-off { background: #ECEAE4; color: var(--muted); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
button.pill:hover { border-color: currentColor; }
.empty { text-align: center; padding: 48px 16px; background: var(--white); border: 1px dashed var(--line); border-radius: var(--r); }

/* Images */
.imgs { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.img { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.img-view { position: relative; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: #fff; }
.img-view img { width: 100%; height: 100%; object-fit: contain; }
.img-main { position: absolute; top: 6px; left: 6px; background: var(--moss-900); color: #fff; font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; display: none; }
.img:first-child .img-main { display: block; }
.img-tools { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.img-tools .del { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 8px; border-radius: 8px; cursor: pointer; color: var(--err); font-size: .85rem; font-weight: 600; }
.img-tools .del input { width: 18px; height: 18px; accent-color: var(--err); }
.img-tools .del span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.img.is-deleted { opacity: .45; border-style: dashed; border-color: var(--err); }
.img-alt summary { font-size: .8rem; color: var(--muted); cursor: pointer; padding: 6px 0; }
.img-alt label { font-size: .75rem; font-weight: 700; display: block; margin-top: 4px; }
.img-alt input { min-height: 36px !important; font-size: .85rem; }
.drop { display: flex; align-items: center; gap: 16px; padding: 20px; border: 2px dashed #BDB5A3; border-radius: 12px; cursor: pointer; background: var(--paper); position: relative; }
.drop:hover, .drop.over { border-color: var(--clay); background: #FBF3EA; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop:focus-within { outline: 3px solid var(--clay); outline-offset: 2px; }
.previews { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.previews li { width: 88px; text-align: center; font-size: .7rem; color: var(--muted); overflow-wrap: anywhere; }
.previews img { width: 88px; height: 88px; object-fit: cover; border-radius: 8px; border: 2px solid var(--ok); }

details.adv summary { cursor: pointer; font-weight: 700; padding: 8px 0; min-height: 44px; }
.confirm { position: relative; }
.confirm summary { list-style: none; }
.confirm summary::-webkit-details-marker { display: none; }
.confirm-box { margin-top: 12px; padding: 16px; background: var(--err-bg); border-radius: 10px; max-width: 480px; }
.confirm-box form { margin: 0; }

/* Save bar */
.savebar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 12px; padding: 12px 16px; margin: 0 -16px; background: rgba(247,245,239,.96); border-top: 1px solid var(--line); backdrop-filter: blur(6px); }

/* Orders / messages */
.order-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 8px; }
.order ul { margin: 0 0 8px; padding-left: 20px; }
.order.is-done, .msg.is-read { opacity: .75; }
.msg-text { white-space: pre-wrap; background: var(--paper); padding: 12px; border-radius: 8px; }
.cat { padding-bottom: 8px; }
.prose ol { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
code { background: var(--moss-100); padding: 2px 6px; border-radius: 4px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--moss-900); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; z-index: 30; }
.toast[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
