/* Klientská zóna a administrácia */
.zone-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-bottom: 18px; }
.zone-head h1, .zone-head h2 { margin: 0; }
.zone-head .eyebrow { width: 100%; margin-bottom: 0; }
.crumbs { font-size: .9rem; margin-bottom: 10px; }
.crumbs a { text-decoration: none; }
.zone-grid { display: grid; gap: 22px; margin-top: 8px; }
@media (min-width: 980px) { .zone-grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.zone-main, .zone-side { min-width: 0; }
.empty { color: var(--muted); font-style: italic; }

/* Stav projektu */
.status { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); white-space: nowrap; }
.status-done { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.status-received, .status-inq-new { background: color-mix(in srgb, var(--bordeaux) 12%, transparent); color: var(--bordeaux); border-color: color-mix(in srgb, var(--bordeaux) 40%, transparent); }
.status-inactive, .status-inq-archived { background: transparent; color: var(--muted); border-color: var(--line-strong); }
.status-inq-converted { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }

.progress { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.progress li { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: .78rem; color: var(--muted); position: relative; }
.progress li::before { content: ""; position: absolute; top: 7px; left: -50%; right: 50%; height: 1px; background: var(--line-strong); z-index: 0; }
.progress li:first-child::before { display: none; }
.progress .dot { width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--paper); position: relative; z-index: 1; }
.progress li.done { color: var(--ink-soft); }
.progress li.done .dot { background: var(--gold); border-color: var(--gold); }
.progress li.done::before, .progress li.current::before { background: var(--gold); }
.progress li.current { color: var(--ink); font-weight: 600; }
.progress li.current .dot { border-color: var(--gold); box-shadow: 0 0 0 5px var(--gold-soft); background: var(--paper); }
.progress li.current .dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--gold); }
@media (max-width: 520px) { .progress .lbl { font-size: .66rem; letter-spacing: -.01em; word-break: break-word; } }
.progress-bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-bottom: 8px; }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 4px; transition: width 1s var(--ease); }

.project-list { display: grid; gap: 18px; }
@media (min-width: 900px) { .project-list { grid-template-columns: 1fr 1fr; } }
.project-card { display: block; color: var(--ink); text-decoration: none; margin: 0; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.project-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.project-card-head h2 { margin: 0; }
.project-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: .86rem; color: var(--muted); margin: 0; }
.badge-new, .badge-q { display: inline-block; font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--bordeaux); color: #fff; }
.badge-q { background: var(--gold); color: #1b1408; }

/* Správy */
.thread { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 88%; border-radius: 16px; padding: 14px 18px; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow-sm); }
.msg-mine { align-self: flex-end; background: color-mix(in srgb, var(--gold) 9%, var(--paper)); border-color: color-mix(in srgb, var(--gold) 30%, var(--line)); border-bottom-right-radius: 4px; }
.msg-other { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-question { border-left: 3px solid var(--gold); }
.msg-question.answered { border-left-color: var(--ok); }
.msg-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.msg-meta strong { color: var(--ink-soft); }
.msg-body p { margin: 0 0 .6em; }
.msg-body p:last-child { margin: 0; }
.attachments { list-style: none; padding: 0; margin: 10px 0 4px; display: flex; flex-wrap: wrap; gap: 10px; }
.attachments a { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 6px 6px; text-decoration: none; color: var(--ink); font-size: .85rem; background: var(--bg); max-width: 100%; }
.attachments a span { overflow: hidden; text-overflow: ellipsis; }
.attachments img { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; flex: none; }
.attachments small { color: var(--muted); }
.file-ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 6px; background: var(--gold-soft); color: var(--gold); flex: none; }
.msg-form { border-top: 1px solid var(--line); padding-top: 18px; }
.answering { background: var(--gold-soft); padding: 8px 12px; border-radius: 10px; font-size: .9rem; }
.file-field input[type="file"] { display: block; font-size: .9rem; margin-bottom: 4px; max-width: 100%; }
.file-field small { color: var(--muted); }

/* Výstupy */
.outputs { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.outputs a { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); background: var(--bg); transition: border-color .2s, transform .2s; }
.outputs a:hover { border-color: var(--gold); transform: translateX(3px); color: var(--ink); }
.outputs strong { display: block; font-weight: 600; }
.outputs small { color: var(--muted); font-size: .82rem; }
.out-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--gold-soft) center / 22px no-repeat; flex: none; position: relative; }
.out-ico::after { content: ""; position: absolute; inset: 0; background: var(--gold); -webkit-mask: var(--m) center / 22px no-repeat; mask: var(--m) center / 22px no-repeat; }
.out-book .out-ico { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M4 5c3-1 6-1 8 .5v14c-2-1.5-5-1.5-8-.5zM20 5c-3-1-6-1-8 .5v14c2-1.5 5-1.5 8-.5z'/%3E%3C/svg%3E"); }
.out-tree .out-ico { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Ccircle cx='12' cy='5' r='2'/%3E%3Ccircle cx='6' cy='13' r='2'/%3E%3Ccircle cx='18' cy='13' r='2'/%3E%3Cpath d='M12 7v3M6 11v-1h12v1M6 15v4M18 15v4'/%3E%3C/svg%3E"); }
.out-pdf .out-ico, .out-file .out-ico { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6'%3E%3Cpath d='M6 3h9l4 4v14H6z'/%3E%3Cpath d='M15 3v4h4M12 10v7m0 0 3-3m-3 3-3-3'/%3E%3C/svg%3E"); }

/* Tabuľky, štatistiky */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.inactive td { opacity: .55; }
.table tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--bordeaux); }
.table a { text-decoration: none; font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { display: flex; flex-direction: column; padding: 16px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .2s; }
.stat:hover { border-color: var(--gold); color: var(--ink); }
.stat strong { font-family: var(--ff-serif); font-size: 2.1rem; line-height: 1; color: var(--gold); font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.stat span { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 18px; }
.filters a:not(.btn) { text-decoration: none; font-size: .86rem; color: var(--ink-soft); padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.filters a.on { background: var(--green); color: var(--green-ink); border-color: var(--green); }
.filters .btn { margin-left: auto; }
.search-form { display: flex; gap: 8px; margin-bottom: 16px; max-width: 460px; }
.list-links { list-style: none; padding: 0; margin: 0; }
.list-links a { display: flex; flex-direction: column; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.list-links li:last-child a { border-bottom: 0; }
.list-links small { color: var(--muted); font-size: .8rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.kv dt { color: var(--muted); font-size: .85rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 10px; } }
.pw-once { border: 2px solid var(--gold); }
.pw-once .pw { font-size: 1.15rem; letter-spacing: .05em; user-select: all; }
.zone-side .card form { margin-bottom: 14px; }
.zone-side .card form:last-child { margin-bottom: 0; }
.danger summary { cursor: pointer; color: var(--bad); font-weight: 500; }
.danger[open] summary { margin-bottom: 12px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.inline-actions form { margin: 0; }
.upload-form { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
