/* ============================================================
   KWMAP – Apple-style design
   Systémové SF písmo, světlý frosted sidebar, hairline linky,
   pill tlačítka, jemné stíny, apple.com modrá #0071e3.
   ============================================================ */

:root {
    --bg: #f5f5f7;
    --card: #ffffff;
    --text: #1d1d1f;
    --muted: #6e6e73;
    --muted-2: #86868b;
    --hairline: rgba(0, 0, 0, .08);
    --hairline-soft: rgba(0, 0, 0, .05);
    --control-border: #d2d2d7;
    --fill: #ececf0;        /* výplň polí a neaktivních prvků */
    --fill-hover: #e4e4e9;

    --blue: #0071e3;
    --blue-hover: #0077ed;
    --blue-soft: rgba(0, 113, 227, .12);
    --blue-ring: rgba(0, 113, 227, .28);

    --green: #34c759;
    --green-text: #1d8a3e;
    --red: #ff3b30;
    --red-text: #d70015;
    --orange-text: #c93400;

    --radius-card: 18px;
    --radius-control: 12px;
    --radius-pill: 980px;

    --shadow-card: 0 2px 6px rgba(0, 0, 0, .03), 0 8px 24px rgba(0, 0, 0, .05);
    --shadow-pop: 0 4px 10px rgba(0, 0, 0, .06), 0 16px 40px rgba(0, 0, 0, .10);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.hidden { display: none !important; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: -.01em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { background: rgba(0, 113, 227, .2); }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ App shell ============ */

.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar (světlé sklo jako macOS) ---------- */

.sidebar {
    flex: 0 0 230px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px 14px 18px;
    background: rgba(249, 249, 251, .82);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
    backdrop-filter: saturate(180%) blur(22px);
    border-right: 1px solid var(--hairline-soft);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 10px 22px;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(180deg, #2b8ff0, #0071e3);
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    box-shadow: 0 3px 8px rgba(0, 113, 227, .35);
}

.brand-name {
    color: var(--text);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.01em;
}
.brand-name b { font-weight: 700; color: var(--blue); }

.side-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }

.side-nav a, .side-foot a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: 10px;
    color: #3a3a3c;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.side-nav a:hover, .side-foot a:hover { background: rgba(0, 0, 0, .045); text-decoration: none; }

.side-nav svg, .side-foot svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--muted-2); }
.side-nav a.active svg { color: var(--blue); }

.side-nav a.active {
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 600;
}

.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--hairline-soft); }

/* ---------- Obsah ---------- */

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 36px 40px 12px;
    animation: fade .3s ease both;
}

@keyframes fade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

.footer {
    text-align: center;
    color: var(--muted-2);
    font-size: 12px;
    padding: 28px 0 32px;
    margin-top: auto;
}

/* ---------- Karty a nadpisy ---------- */

.card {
    background: var(--card);
    border: 1px solid var(--hairline-soft);
    border-radius: var(--radius-card);
    padding: 26px 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
    overflow-x: auto; /* široká tabulka se roluje uvnitř karty */
}

.card-narrow {
    max-width: 400px;
    margin: 10vh auto 0;
    padding: 38px 36px;
    box-shadow: var(--shadow-pop);
    border-radius: 22px;
}

h1 { font-size: 28px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.022em; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 16px; letter-spacing: -.017em; }
h3 { font-weight: 600; letter-spacing: -.01em; }

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}
@media (max-width: 900px) { .grid-two { grid-template-columns: 1fr; } }

/* ---------- Tabulky ---------- */

table { width: 100%; border-collapse: collapse; }

th, td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    font-size: 14px;
}

th {
    color: var(--muted-2);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

tbody tr { transition: background .12s; }
tbody tr:hover { background: #f7f7f9; }
tr:last-child td { border-bottom: none; }

.num { text-align: right; font-variant-numeric: tabular-nums; }
.actions { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; color: var(--text); text-decoration: none; }
.strong:hover { color: var(--blue); text-decoration: none; }
.muted { color: var(--muted); }
a.muted { text-decoration: none; }
a.muted:hover { text-decoration: underline; }
.small { font-size: 12.5px; }
.inline { display: inline; }

th.sortable { cursor: pointer; user-select: none; transition: color .15s; }
th.sortable:hover { color: var(--blue); }
.sort-arrow { font-size: 9px; color: var(--blue); }

/* Tabulka klíčových slov */

.table-scroll { overflow-x: auto; margin: 0 -28px; padding: 0 28px; }

.kw-table thead th { background: var(--card); }
.thead-groups th { border-bottom: none; padding-bottom: 4px; }

.group-head {
    text-align: center !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .09em;
    border-radius: 10px 10px 0 0;
    padding-top: 9px;
}

.group-google { color: #0058b0; background: #f0f6ff; }
.group-seznam { color: #c22e2e; background: #fff2f1; }

td.sec-g, th.sec-g:not(.group-head) { background: #fafcff; }
td.sec-s, th.sec-s:not(.group-head) { background: #fffafa; }
.sec-first { border-left: 1px solid rgba(0, 0, 0, .06); }
.sec-last  { border-right: 1px solid rgba(0, 0, 0, .06); }
tbody tr:hover td.sec-g { background: #f1f6fe; }
tbody tr:hover td.sec-s { background: #fdf1f0; }

.check-cell { width: 36px; text-align: center; }
.check-cell input { cursor: pointer; accent-color: var(--blue); width: 16px; height: 16px; border-radius: 5px; }

.kw-cell { max-width: 280px; }
.url-cell { max-width: 158px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-cell a { color: var(--muted); text-decoration: none; font-size: 12.5px; }
.url-cell a:hover { color: var(--blue); text-decoration: underline; }

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.table-title { margin: 0; }
.table-tools { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

/* Vyhledávací pole – pilulka jako v macOS */
.table-tools input[type=search], input[type=search] {
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-size: 13.5px;
    width: 220px;
    font-family: inherit;
    background: var(--fill);
    color: var(--text);
    transition: background .15s, border-color .15s, box-shadow .15s;
}
input[type=search]:focus {
    outline: none;
    background: var(--card);
    border-color: var(--blue);
    box-shadow: 0 0 0 3.5px var(--blue-ring);
}

.table-footnote { margin: 12px 0 0; }

/* Chipy pozic – měkké iOS badge */

.pos-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 12.5px;
}

.pos-top3  { background: #e4f7ea; color: #1d8a3e; }
.pos-top10 { background: #eef7dd; color: #4f7a12; }
.pos-top30 { background: #fdf1d7; color: #b25000; }
.pos-deep  { background: #fde9e7; color: #d70015; }
.pos-out   { background: #f0f0f3; color: #98989d; font-weight: 500; }

.change-up { color: var(--green-text); font-weight: 600; }
.change-down { color: var(--red-text); font-weight: 600; }
.change-neutral { color: var(--muted-2); }

/* Filtrační chipy – pilulky */

.filter-chips { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }

.chip {
    border: none;
    background: var(--fill);
    color: var(--text);
    border-radius: var(--radius-pill);
    padding: 7px 15px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, color .15s, box-shadow .15s;
}
.chip:hover { background: var(--fill-hover); }
.chip.active { background: var(--blue); color: #fff; font-weight: 600; }

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    background: var(--fill);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .02em;
}

.btn-icon {
    border: none;
    background: transparent;
    color: var(--muted-2);
    font-size: 16px;
    cursor: pointer;
    padding: 3px 9px;
    border-radius: 8px;
    line-height: 1;
    transition: background .12s, color .12s;
}
.btn-icon:hover { background: #fde9e7; color: var(--red-text); }

.tips { margin: 0; padding-left: 18px; }
.tips li { margin-bottom: 9px; font-size: 13.5px; }

/* ---------- Formuláře ---------- */

label { display: block; margin-bottom: 16px; font-weight: 500; font-size: 13.5px; color: var(--text); }

input[type=text], input[type=password], input[type=email], textarea {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 10px 14px;
    border: 1px solid var(--control-border);
    border-radius: var(--radius-control);
    font-size: 14.5px;
    font-family: inherit;
    font-weight: 400;
    color: var(--text);
    background: var(--card);
    transition: border-color .15s, box-shadow .15s;
}

/* Selecty s vlastní šipkou – pryč se systémovým 90s vzhledem */
select {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 10px 38px 10px 14px;
    border: 1px solid var(--control-border);
    border-radius: var(--radius-control);
    font-size: 14.5px;
    font-family: inherit;
    color: var(--text);
    background-color: var(--card);
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%2386868b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 13px center;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

input[type=text]:focus, input[type=password]:focus, input[type=email]:focus,
textarea:focus, select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3.5px var(--blue-ring);
}

fieldset {
    border: 1px solid var(--hairline);
    border-radius: 14px;
    margin: 0 0 16px;
    padding: 14px 16px;
    background: #fafafc;
}

legend {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted-2);
    padding: 0 8px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.checkbox { display: inline-flex; align-items: center; gap: 8px; margin: 0 18px 0 0; font-weight: 400; }
.checkbox input { accent-color: var(--blue); width: 16px; height: 16px; }

input[type=file] { display: block; margin-top: 7px; font-size: 13.5px; color: var(--muted); }
input[type=file]::file-selector-button {
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: var(--fill);
    border: none;
    border-radius: var(--radius-pill);
    padding: 7px 14px;
    margin-right: 10px;
    cursor: pointer;
    transition: background .15s;
}
input[type=file]::file-selector-button:hover { background: var(--fill-hover); }

/* ---------- Tlačítka – pilulky jako na apple.com ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--fill);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: background .16s, transform .12s, box-shadow .16s;
}
.btn:hover { background: var(--fill-hover); text-decoration: none; }
.btn:active { transform: scale(.98); }

.btn-primary {
    background: var(--blue);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 113, 227, .3);
}
.btn-primary:hover { background: var(--blue-hover); box-shadow: 0 4px 14px rgba(0, 113, 227, .4); }

.btn-danger { background: #fde9e7; color: var(--red-text); }
.btn-danger:hover { background: #fbd9d5; }

.btn-small { padding: 6px 13px; font-size: 13px; }

.form-actions { display: flex; gap: 10px; margin-top: 8px; }

/* ---------- Import / Průzkumník ---------- */

.import-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.import-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.import-actions select { width: auto; margin: 0; }

.explorer-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.explorer-form label { margin-bottom: 0; flex: 1 1 220px; }
.explorer-form .explorer-expand { flex: 0 0 auto; padding-bottom: 10px; }
.explorer-form button { margin-bottom: 1px; }

/* ---------- Hlášky ---------- */

.flash {
    padding: 12px 18px;
    border-radius: 14px;
    margin-bottom: 16px;
    font-size: 13.5px;
    font-weight: 500;
}

.flash-success { background: #e4f7ea; color: #146c33; }
.flash-error   { background: #fde9e7; color: #b3000f; }
.flash-warning { background: #fdf1d7; color: #8f4300; }

.log-error td { color: var(--red-text); }
.log-warning td { color: var(--orange-text); }

code {
    background: var(--fill);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 12.5px;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    color: var(--text);
}

hr { border: none; border-top: 1px solid var(--hairline); margin: 20px 0; }

.chart-wrap { position: relative; height: 320px; }

/* ---------- Statistické karty ---------- */

.stat-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }

.stat-card {
    background: var(--card);
    border: 1px solid var(--hairline-soft);
    border-radius: var(--radius-card);
    padding: 20px 24px;
    box-shadow: var(--shadow-card);
    flex: 1 1 150px;
    min-width: 150px;
    transition: transform .16s, box-shadow .16s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.028em;
    line-height: 1.15;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.stat-label { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.cluster-filter { cursor: pointer; }

/* Pruhy skupin */
.cluster-bars { display: flex; flex-direction: column; gap: 12px; }
.cluster-bar-row { cursor: pointer; }
.cluster-bar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.cluster-bar-name { font-weight: 600; font-size: 13.5px; }
.cluster-bar-meta { color: var(--muted); font-size: 12px; }
.cluster-bar-track { height: 7px; background: var(--fill); border-radius: var(--radius-pill); overflow: hidden; }
.cluster-bar-fill { height: 100%; background: var(--blue); border-radius: var(--radius-pill); transition: width .3s; }
.cluster-bar-row:hover .cluster-bar-fill { background: var(--blue-hover); }

/* Rozdělení konkurence */
.comp-split { display: flex; height: 30px; border-radius: 10px; overflow: hidden; }
.comp-seg { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 12.5px; min-width: 24px; }
.comp-seg.comp-low { background: #34c759; }
.comp-seg.comp-mid { background: #ff9500; }
.comp-seg.comp-high { background: #ff3b30; }
.comp-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.comp-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
.dot.comp-low { background: #34c759; }
.dot.comp-mid { background: #ff9500; }
.dot.comp-high { background: #ff3b30; }

/* Rozdělení pozic (detail projektu) */
.dist { margin-top: 8px; }
.dist-head { font-size: 11px; font-weight: 600; color: var(--muted-2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.dist-bar { display: flex; height: 28px; border-radius: 10px; overflow: hidden; }
.dseg { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 12.5px; min-width: 0; }
.dseg.pos-top3  { background: #34c759; }
.dseg.pos-top10 { background: #8fce3c; }
.dseg.pos-top30 { background: #ff9500; }
.dseg.pos-deep  { background: #ff3b30; }
.dseg.pos-out   { background: #c7c7cc; }
.dist-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.dist-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: baseline; }
.dist-legend .dot.pos-top3 { background: #34c759; }
.dist-legend .dot.pos-top10 { background: #8fce3c; }
.dist-legend .dot.pos-top30 { background: #ff9500; }
.dist-legend .dot.pos-deep { background: #ff3b30; }
.dist-legend .dot.pos-out { background: #c7c7cc; }

/* Ahrefs DR */
.dr-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 8px 6px 14px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-pill);
    background: var(--card);
    font-size: 13px;
    box-shadow: var(--shadow-card);
}
.dr-chip-label { font-weight: 600; color: var(--muted-2); letter-spacing: .05em; font-size: 11px; }
.dr-chip-value { font-weight: 700; color: var(--blue); font-size: 15px; }
.dr-refresh {
    border: none;
    background: none;
    color: var(--muted-2);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 6px;
    transition: color .12s, transform .3s;
}
.dr-refresh:hover { color: var(--blue); transform: rotate(180deg); }
.dr-refresh:disabled { opacity: .5; cursor: default; }
.dr-pill {
    display: inline-block;
    min-width: 26px;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 12.5px;
    background: var(--blue-soft);
    color: var(--blue);
}
.dr-overview { display: flex; align-items: center; gap: 18px; margin: 4px 0 2px; }
.dr-big { font-size: 44px; font-weight: 700; letter-spacing: -.03em; color: var(--text); line-height: 1; }
.dr-big-max { font-size: 16px; font-weight: 500; color: var(--muted-2); }
.dr-spark { flex: 1 1 auto; height: 46px; max-width: 260px; }

/* Datum poslední aktualizace v detailu projektu */
.upd-line { margin: 6px 0 0; color: var(--muted); }
.upd-line .upd-ok { color: var(--green-text); font-weight: 600; }
.upd-line .upd-stale { color: var(--red-text); font-weight: 600; }

/* Vzorová analýza – banner */
.sample-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    margin-bottom: 22px;
    background: var(--card);
    border: 1px solid var(--hairline-soft);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}
.sample-banner .sample-icon { font-size: 28px; line-height: 1; }
.sample-banner .sample-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.sample-banner .sample-text strong { font-size: 14.5px; }
.sample-banner .sample-text span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.sample-banner .btn { white-space: nowrap; flex: 0 0 auto; }
@media (max-width: 640px) {
    .sample-banner { flex-wrap: wrap; }
    .sample-banner .btn { width: 100%; }
}

/* Bulk akce */
.bulk-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bulk-actions select { width: auto; margin: 0; }
.bulk-actions .bulk-count { font-size: 13px; color: var(--muted); white-space: nowrap; font-weight: 500; }
.bulk-actions #bulkNewGroup { width: 150px; margin: 0; }

/* Editační karta analýzy */
.edit-card { margin-bottom: 22px; }
.edit-card > summary { cursor: pointer; padding: 5px 0; user-select: none; font-size: 14.5px; }
.edit-card > summary::marker { color: var(--blue); }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.edit-block { display: flex; flex-direction: column; gap: 9px; padding: 16px; background: #fafafc; border: 1px solid var(--hairline-soft); border-radius: 14px; }
.edit-block h3 { margin: 0 0 2px; font-size: 13.5px; }
.edit-block select, .edit-block input, .edit-block textarea { margin: 0; }
.edit-block .btn { align-self: flex-start; }
.edit-block-wide { grid-column: 1 / -1; }
.edit-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.edit-row select { width: auto; margin: 0; }
.edit-row .js-new-group { width: 180px; }
@media (max-width: 720px) { .edit-grid { grid-template-columns: 1fr; } }

/* Filtry projektů */
.filter-label { font-size: 11px; color: var(--muted-2); margin-right: 2px; align-self: center; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.filter-groups { margin-bottom: 8px; }
.badge-group {
    margin-left: 8px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 10.5px;
    vertical-align: middle;
}

/* Hvězdička priority */
.star-col { width: 30px; text-align: center; padding-left: 4px; padding-right: 4px; }
th.star-col { cursor: pointer; }
.star-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    padding: 2px 4px;
    color: #d1d1d6;
    transition: color .12s, transform .1s;
}
.star-btn:hover { color: #ff9500; transform: scale(1.15); }
.star-btn.on { color: #ff9500; }
.star-btn:disabled { opacity: .5; cursor: default; }
.chip.star-filter { display: inline-flex; align-items: center; gap: 2px; }
.chip.star-filter.active { background: #ff9500; color: #fff; }

/* ---------- Responsivita ---------- */

@media (max-width: 900px) {
    .app { flex-direction: column; }
    .sidebar {
        position: static;
        height: auto;
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 10px 14px;
        border-right: none;
        border-bottom: 1px solid var(--hairline-soft);
    }
    .brand { padding: 0 8px 0 0; }
    .brand-name { display: none; }
    .side-nav { flex-direction: row; margin: 0; overflow-x: auto; scrollbar-width: none; }
    .side-nav::-webkit-scrollbar { display: none; }
    .side-nav a { padding: 8px 11px; white-space: nowrap; }
    .side-nav svg { display: none; }
    .side-foot { margin: 0 0 0 auto; padding: 0; border: none; }
    .side-foot svg { display: none; }
    .container { padding: 20px 16px 10px; }
    .card { padding: 20px 18px; }
    .table-scroll { margin: 0 -18px; padding: 0 18px; }
    h1 { font-size: 24px; }
}

/* ============================================================
   Strukturální komponenty (Apple)
   ============================================================ */

/* --- Segmentový přepínač (macOS segmented control) --- */
.toolbar-filters { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar-filters .filter-label { margin: 0; }
.seg {
    display: inline-flex;
    gap: 2px;
    background: var(--fill);
    border-radius: 10px;
    padding: 3px;
}
.seg .chip {
    background: transparent;
    border-radius: 8px;
    padding: 6px 13px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}
.seg .chip:hover { background: rgba(0, 0, 0, .045); }
.seg .chip.active {
    background: #fff;
    color: var(--text);
    font-weight: 600;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .06), 0 2px 6px rgba(0, 0, 0, .10);
}

/* --- Rozbalovací menu (⋯) --- */
.menu { position: relative; display: inline-block; }
.menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 7px);
    min-width: 270px;
    background: rgba(252, 252, 253, .97);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 16px;
    box-shadow: 0 0 0 .5px rgba(0, 0, 0, .04), 0 10px 20px rgba(0, 0, 0, .10), 0 24px 60px rgba(0, 0, 0, .16);
    padding: 8px;
    z-index: 80;
    animation: menuPop .14s cubic-bezier(.2, .9, .3, 1.2) both;
    transform-origin: top right;
}
@keyframes menuPop {
    from { opacity: 0; transform: scale(.96) translateY(-4px); }
    to   { opacity: 1; transform: none; }
}
.menu-panel form { display: block; margin: 0; }
.menu-item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 11px;
    padding: 10px 13px;
    border: none;
    background: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.3;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    text-align: left;
    transition: background .1s, color .1s;
}
.menu-item:hover { background: var(--blue); color: #fff; text-decoration: none; }
.menu-sep { height: 1px; background: rgba(0, 0, 0, .07); margin: 7px 4px; }
.menu-title { font-size: 11px; font-weight: 600; color: var(--muted-2); text-transform: uppercase; letter-spacing: .07em; padding: 8px 13px 4px; }
.menu-trigger .chev { font-size: 10px; color: var(--muted-2); margin-left: 2px; transition: transform .15s; }

/* --- Formuláře ve stylu macOS Nastavení (řádky v kartě) --- */
.form-card { padding: 0; overflow: hidden; }
.form-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted-2);
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 18px 24px 8px;
}
.form-rows { display: flex; flex-direction: column; }
.form-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 18px;
    align-items: center;
    padding: 13px 24px;
    border-bottom: 1px solid var(--hairline-soft);
}
.form-rows .form-row:last-child { border-bottom: none; }
.form-row-label { font-weight: 500; font-size: 13.5px; color: var(--text); }
.form-row-label .muted { display: block; font-weight: 400; font-size: 12px; margin-top: 1px; }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=email],
.form-row select, .form-row textarea { margin-top: 0; }
.form-row .checkbox { margin: 0 16px 0 0; }
.form-footer {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 16px 24px;
    background: #fafafc;
    border-top: 1px solid var(--hairline-soft);
}
.form-footer .spacer { flex: 1 1 auto; }
@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; gap: 6px; }
}

/* --- Favicony webů --- */
.site-ico {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    vertical-align: -4px;
    margin-right: 9px;
    background: #fff;
    box-shadow: 0 0 0 1px var(--hairline-soft);
}
.site-ico-lg { width: 30px; height: 30px; border-radius: 7px; vertical-align: -5px; margin-right: 11px; }

/* --- Vzdušnost --- */
.container { padding-top: 42px; }
h1 { font-size: 30px; }
.page-head { margin-bottom: 28px; }
.card { margin-bottom: 26px; }
.table-toolbar { margin-bottom: 18px; row-gap: 10px; }
tbody td { padding-top: 13px; padding-bottom: 13px; }
