:root {
  --teal: #7ebec2; --teal-pale: #e6f1f2; --ink: #000; --paper: #fff; --muted: #4a5859; --bg: #f5f8f8;
  --danger: #a42d12; --f: "Archivo", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--f); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); font-stretch: 115%; letter-spacing: -.025em; line-height: 1.1; margin: 0 0 6px; font-weight: 600; }
h2 { font-size: 1.3rem; font-stretch: 110%; letter-spacing: -.015em; margin: 0 0 14px; font-weight: 600; }
h3 { font-size: 1.05rem; margin: 26px 0 10px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.a-top { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; background: var(--teal); padding: 12px clamp(16px, 3vw, 40px); border-bottom: 1.5px solid var(--ink); }
.a-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; margin-right: auto; }
.a-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.a-nav a { text-decoration: none; padding: 8px 14px; font-weight: 600; border: 1.5px solid transparent; }
.a-nav a:hover { border-color: var(--ink); }
.a-nav a[aria-current] { background: var(--ink); color: var(--paper); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; background: var(--paper); color: var(--ink); font-size: .78rem; text-align: center; border: 1px solid var(--ink); margin-left: 4px; }
.a-nav a[aria-current] .badge { background: var(--teal); }
.a-user { display: flex; align-items: center; gap: 18px; font-size: .92rem; }
.a-user form { margin: 0; }

.a-main { max-width: 1240px; margin: 0 auto; padding: clamp(20px, 3vw, 40px) clamp(16px, 3vw, 40px) 80px; }
.a-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.a-head p { margin: 0; max-width: 60ch; }
.a-muted { color: var(--muted); }
.a-back { display: inline-block; margin-bottom: 8px; text-decoration: none; font-weight: 600; font-size: .92rem; }
.a-back::before { content: "← "; }

.a-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; background: var(--ink); color: var(--paper); border: 1.5px solid var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; border-radius: 0; }
.a-btn:hover { background: #222; }
.a-btn-line { background: transparent; color: var(--ink); }
.a-btn-line:hover { background: var(--teal-pale); }
.a-btn-sm { min-height: 34px; padding: 0 12px; font-size: .9rem; }
.a-btn-danger { background: var(--danger); border-color: var(--danger); }
.a-btn-danger:hover { background: #7f200b; }
.a-link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.a-icon { width: 34px; height: 34px; display: inline-grid; place-items: center; background: var(--paper); border: 1.5px solid var(--ink); cursor: pointer; font: inherit; font-size: 1rem; }
.a-icon:hover:not(:disabled) { background: var(--teal-pale); }
.a-icon:disabled { opacity: .3; cursor: default; }
.a-icon.on { background: var(--teal); }
.a-danger { color: var(--danger); }
.a-icon.a-danger { border-color: var(--danger); }

.a-flash { padding: 12px 16px; font-weight: 600; margin: 0 0 20px; border: 1.5px solid var(--ink); }
.a-flash-ok { background: var(--teal); }
.a-flash-err { background: #ffe3dc; border-color: var(--danger); color: #6e1d0b; }
.a-note { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: #fff6d8; border: 1.5px solid #8a6d00; padding: 14px 18px; margin: 0 0 24px; }
.a-note p { margin: 0; }
.a-note form { margin: 0; }
.a-empty { background: var(--paper); border: 1.5px dashed var(--ink); padding: 40px; text-align: center; }
.a-empty p { max-width: 46ch; margin: 0 auto 16px; }

.tag { display: inline-block; font-size: .76rem; padding: 1px 8px; border: 1px solid var(--ink); background: var(--paper); font-weight: 600; }
.tag-err { background: #ffe3dc; border-color: var(--danger); color: #6e1d0b; }
.a-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.a-head-actions form { margin: 0; }
.tag-off { background: #eee; color: #555; border-color: #999; }
.tag-cover { position: absolute; top: 8px; left: 8px; background: var(--teal); }

/* seznam zakázek */
.a-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.a-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 18px; align-items: center; background: var(--paper); border: 1.5px solid var(--ink); padding: 10px; }
.a-row.is-hidden { opacity: .6; background: #f0f0f0; }
.a-row-img { aspect-ratio: 4 / 3; background: var(--teal-pale); display: grid; place-items: center; overflow: hidden; text-decoration: none; font-size: .8rem; color: var(--muted); }
.a-row-img img { width: 100%; height: 100%; object-fit: cover; }
.a-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.a-row-title { font-weight: 600; font-size: 1.1rem; text-decoration: none; }
.a-row-title:hover { text-decoration: underline; }
.a-tags { display: flex; gap: 6px; }
.a-row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.a-row-actions form { display: flex; gap: 6px; margin: 0; }

/* formuláře */
.a-form { display: grid; gap: 16px; }
.a-form label { display: grid; gap: 5px; font-weight: 600; font-size: .95rem; }
.a-form label small { font-weight: 400; color: var(--muted); }
.a-form label em { font-style: normal; font-weight: 400; color: var(--muted); font-size: .85rem; }
.a-form input:not([type=checkbox]):not([type=file]), .a-form select, .a-form textarea {
  font: inherit; font-weight: 400; width: 100%; padding: 10px 12px; border: 1.5px solid var(--ink); background: var(--paper); border-radius: 0; min-height: 44px;
}
.a-form textarea { resize: vertical; }
.a-form input:focus, .a-form select:focus, .a-form textarea:focus { outline: 3px solid var(--teal); outline-offset: 0; }
.a-check { display: flex !important; align-items: center; gap: 10px; font-weight: 500 !important; }
.a-check input { width: 20px; height: 20px; accent-color: #000; }
.a-cols { display: grid; grid-template-columns: 1.7fr 1fr; gap: clamp(20px, 3vw, 40px); align-items: start; }
.a-col-main, .a-col-side { display: grid; gap: 16px; }
.a-edit .a-col-main, .a-edit .a-col-side, .a-cols > section { background: var(--paper); border: 1.5px solid var(--ink); padding: clamp(16px, 2vw, 28px); }
.a-actions { display: flex; align-items: center; gap: 20px; position: sticky; bottom: 0; background: var(--bg); padding: 14px 0; border-top: 1.5px solid var(--ink); }
.a-narrow { max-width: 420px; }

.a-drop { position: relative; border: 2px dashed var(--ink); background: var(--teal-pale); padding: 26px; transition: background .15s; }
.a-drop.over { background: var(--teal); }
.a-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.a-drop label { display: grid; gap: 4px; pointer-events: none; }
.a-drop strong { font-size: 1.15rem; }
.a-drop span { font-weight: 400; color: var(--muted); max-width: 70ch; }
.a-drop-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; position: relative; pointer-events: none; }
.a-drop-list:empty { display: none; }
.a-drop-list li { width: 86px; }
.a-drop-list img { width: 86px; height: 64px; object-fit: cover; border: 1px solid var(--ink); }
.a-drop-list small { display: block; font-size: .7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-progress { position: relative; height: 34px; border: 1.5px solid var(--ink); background: var(--paper); }
.a-progress span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--teal); transition: width .2s; }
.a-progress em { position: relative; font-style: normal; font-weight: 600; line-height: 31px; padding-left: 12px; }

/* fotky */
.a-photos { margin-top: 40px; }
.a-gal { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.a-gal-item { position: relative; background: var(--paper); border: 1.5px solid var(--ink); padding: 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.a-gal-item.is-cover { outline: 3px solid var(--teal); outline-offset: 2px; }
.a-gal-item img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: var(--teal-pale); }
.a-cap { display: flex; gap: 6px; margin: 0; }
.a-cap input { flex: 1; min-width: 0; font: inherit; font-size: .9rem; padding: 6px 8px; border: 1px solid var(--ink); }
.a-gal-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.a-gal-actions .a-danger { margin-left: auto; }

.a-danger-zone { margin-top: 56px; padding: 20px; border: 1.5px solid var(--danger); background: var(--paper); }
.a-danger-zone p { max-width: 70ch; }

/* tým */
.a-team { display: grid; gap: 16px; }
.a-team h2 { margin-top: 24px; }
.a-member { grid-template-columns: 150px 1fr; background: var(--paper); border: 1.5px solid var(--ink); padding: 16px; gap: 20px; }
.a-member-photo { display: grid; gap: 8px; align-content: start; }
.a-member-photo img, .a-member-photo > span { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; background: var(--teal-pale); display: grid; place-items: center; font-size: .85rem; color: var(--muted); clip-path: polygon(50% 0, 100% 30%, 100% 100%, 0 100%, 0 30%); }
.a-file { font-size: .85rem !important; }
.a-file input { font-size: .8rem; max-width: 100%; }
.a-member-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.a-wide { grid-column: 1 / -1; }
.a-member-actions { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-top: 1px solid #ccc; padding-top: 12px; }
.a-member-actions .a-danger { margin-left: auto; }

/* zprávy */
.a-msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.a-msg { background: var(--paper); border: 1.5px solid #9aa; padding: 16px 20px; }
.a-msg.is-new { border-color: var(--ink); box-shadow: inset 6px 0 0 var(--teal); }
.a-msg-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.a-msg-head time { margin-left: auto; font-size: .9rem; }
.a-msg-contact { margin: 4px 0 10px; font-size: .95rem; }
.a-msg-body { white-space: normal; max-width: 75ch; }
.a-msg-actions { display: flex; gap: 16px; align-items: center; margin-top: 12px; }

.a-users { list-style: none; margin: 0; padding: 0; }
.a-users li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #ddd; }
.a-users form { margin: 0; }

/* přihlášení */
.is-guest { background: var(--teal); }
.a-auth { max-width: 440px; margin: 8vh auto 0; background: var(--paper); border: 1.5px solid var(--ink); outline: 1.5px solid var(--ink); outline-offset: 8px; padding: 36px; }
.a-auth img { margin-bottom: 24px; }
.a-auth h1 { font-size: 1.6rem; margin-bottom: 12px; }
.a-auth .a-btn { margin-top: 6px; }

@media (max-width: 860px) {
  .a-cols { grid-template-columns: 1fr; }
  .a-row { grid-template-columns: 90px 1fr; }
  .a-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .a-member { grid-template-columns: 1fr; }
  .a-member-photo { max-width: 160px; }
  .a-member-fields { grid-template-columns: 1fr; }
  .a-user { width: 100%; justify-content: space-between; }
}
