/* ============================================================================
   Gym Tracker - tmavý mobilný-first dizajn
   ========================================================================== */

:root {
    --bg: #0a0a0b;
    --bg-elev: #131417;
    --bg-elev-2: #1b1d22;
    --border: #26282e;
    --text: #f4f4f5;
    --text-dim: #9ca3af;
    --accent: #2f6bff;
    --accent-hover: #2458d9;
    --accent-soft: rgba(47, 107, 255, .14);
    --success: #2ecc71;
    --danger: #ef4444;
    --warning: #f5a623;
    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    --shadow-soft: 0 4px 16px rgba(0, 0, 0, .28);

    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.app { min-height: 100vh; }

/* ---------------- Layout ---------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    background: rgba(10, 10, 11, .9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.sidebar {
    display: none;
}

.main-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px 120px;
}

/* ---------------- Brand ---------------- */

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: .2px;
}

.brand-mark { font-size: 24px; }
.brand-text { font-size: 18px; }

.brand-img {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    object-fit: cover;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    flex-shrink: 0;
}

/* ---------------- Buttons ---------------- */

.btn {
    --btn-bg: var(--bg-elev-2);
    --btn-fg: var(--text);
    --btn-border: var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: transform .06s ease, background .15s ease, border-color .15s ease;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(.97); }

.btn-primary {
    --btn-bg: var(--accent);
    --btn-fg: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-success {
    --btn-bg: var(--success);
    --btn-fg: #062b16;
}
.btn-success:hover { filter: brightness(1.06); }

.btn-danger {
    --btn-bg: var(--danger);
    --btn-fg: #fff;
}
.btn-danger:hover { filter: brightness(1.06); }

.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-elev); }

.btn-outline { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); font-weight: 700; }
.btn-outline:hover { background: var(--accent-soft); }

.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { min-height: 54px; padding: 14px 22px; font-size: 17px; border-radius: 14px; }
.btn-block { width: 100%; }

.icon-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 19px;
    cursor: pointer;
}

.cta-big {
    margin: 8px 0 20px;
    font-size: 17px;
    letter-spacing: .4px;
    box-shadow: 0 10px 26px rgba(47, 107, 255, .35);
}

/* ---------------- Cards ---------------- */

.card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 16px;
    margin-bottom: 14px;
}

.card-empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--text-dim);
}
.card-empty p { margin: 0 0 14px; }

/* ---------------- Titles ---------------- */

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.page-title { margin: 0; font-size: 24px; line-height: 1.2; }
.page-sub { margin: 4px 0 0; color: var(--text-dim); font-size: 14px; }

.section-title {
    font-size: 17px;
    font-weight: 700;
    margin: 22px 0 12px;
    color: var(--text);
}

.back-link {
    display: inline-block;
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 8px;
}
.back-link:hover { color: var(--text); }

/* ---------------- Stats ---------------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    margin-bottom: 0;
}

.stat-label { color: var(--text-dim); font-size: 13px; font-weight: 600; }
.stat-value { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.stat-value small { font-size: 13px; color: var(--text-dim); font-weight: 600; }
.stat-value-sm { font-size: 17px; letter-spacing: 0; }

/* ---------------- Alerts / badges ---------------- */

.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    font-size: 14.5px;
    font-weight: 600;
}
.alert-danger  { background: rgba(239, 68, 68, .12);  border: 1px solid rgba(239, 68, 68, .4);  color: #fca5a5; }
.alert-success { background: rgba(46, 204, 113, .12); border: 1px solid rgba(46, 204, 113, .4);  color: #7ee2b0; }
.alert-warning { background: rgba(245, 166, 35, .12); border: 1px solid rgba(245, 166, 35, .4);  color: #fcd34d; }
.alert-info    { background: rgba(47, 107, 255, .12); border: 1px solid rgba(47, 107, 255, .4);  color: #9db8ff; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.badge-blue    { background: var(--accent-soft);   color: #9db8ff; }
.badge-danger  { background: rgba(239, 68, 68, .14); color: #fca5a5; }
.badge-success { background: rgba(46, 204, 113, .14); color: #7ee2b0; }

/* ---------------- Fields / inputs ---------------- */

.field { display: block; margin-bottom: 16px; }
.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 7px;
}

.input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    background: var(--bg-elev-2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 16px;
    outline: none;
    transition: border-color .15s ease;
    color-scheme: dark;
}
.input:focus { border-color: var(--accent); }

textarea.input { min-height: 90px; resize: vertical; line-height: 1.45; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 14px;
}

.check-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
    cursor: pointer;
    font-size: 15px;
}
.check-field input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------------- Chips ---------------- */

.chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.chip-filter {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.chip-filter.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.chip-check {
    cursor: pointer;
    user-select: none;
}
.chip-check input { display: none; }
.chip-check:has(input:checked) {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ---------------- Exercise grid ---------------- */

.field-facts-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0 14px;
}

.ex-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.ex-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    text-align: left;
    padding: 10px;
    margin-bottom: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
}
.ex-card:hover { border-color: var(--accent); }

.ex-thumb {
    display: block;
    width: 100%;
    height: 88px;
    object-fit: contain;
    object-position: center;
    background: var(--bg-elev-2);
    border-radius: 10px;
    margin-bottom: 8px;
}

.ex-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 88px;
    font-size: 32px;
    background: var(--bg-elev-2);
    border-radius: 10px;
    margin-bottom: 8px;
}
.ex-icon-lg { width: 56px; height: 56px; font-size: 27px; }

.ex-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ex-name { font-weight: 700; font-size: 14px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-model { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-type { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ex-chevron { color: var(--text-dim); font-size: 20px; }
.ex-card .ex-chevron { display: none; }

.detail-img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 12px;
    background: var(--bg-elev-2);
    margin-bottom: 12px;
}

.editor-thumb {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--bg-elev-2);
}
.editor-head-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

/* ---------------- Set editor ---------------- */

.set-editor { margin: 18px 0; }

.set-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.set-editor-name { font-weight: 800; font-size: 17px; }
.set-editor-cat { color: var(--text-dim); font-size: 13px; }

.set-editor-last {
    background: var(--bg-elev);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 14px;
    font-size: 13.5px;
    color: var(--text-dim);
}
.set-editor-last b { color: var(--text); }

.set-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.set-row {
    display: grid;
    grid-template-columns: 34px 1fr 1fr 40px;
    align-items: center;
    gap: 8px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
}

.set-head {
    display: grid;
    grid-template-columns: 34px 1fr 1fr 40px;
    align-items: center;
    gap: 8px;
    padding: 0 8px 2px;
}
.set-head .set-label { text-align: left; font-size: 12px; }

.set-row input {
    min-width: 0;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 17px;
    font-weight: 700;
    padding: 12px 4px;
    outline: none;
    text-align: center;
}
.set-row input::placeholder { color: var(--text-dim); opacity: .5; }

.set-row .unit { font-size: 13px; color: var(--text-dim); font-weight: 600; }

.set-row.read {
    grid-template-columns: 34px 1fr 1fr 1fr;
    padding: 10px 12px;
    background: transparent;
    border: none;
}
.set-label { text-align: center; color: var(--text-dim); font-weight: 700; font-size: 14px; }
.set-value { font-weight: 700; font-size: 15px; }
.set-vol { text-align: right; font-size: 13px; }

.remove-set {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 18px;
    cursor: pointer;
    border-radius: 10px;
}
.remove-set:hover { color: var(--danger); background: rgba(239, 68, 68, .1); }

.set-actions { display: flex; flex-direction: column; gap: 10px; }

.set-editor-foot { margin-top: 12px; color: var(--text-dim); font-size: 13.5px; }

/* ---------------- Workout bar ---------------- */

.workout-bar {
    position: sticky;
    bottom: calc(78px + env(safe-area-inset-bottom));
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(19, 20, 23, .96);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}
.workout-bar-left { flex: 1; min-width: 0; }
.workout-bar-title { font-weight: 700; font-size: 14px; display: block; }
.workout-bar .btn { min-height: 48px; white-space: nowrap; }

/* ---------------- Summary / items ---------------- */

.summary-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.summary-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 4px; }

.row-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.row-actions .btn { flex: 1; }

.inline-form { display: inline; margin: 0; }

.sticky-actions {
    position: sticky;
    bottom: calc(78px + env(safe-area-inset-bottom));
    z-index: 30;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 6px 0 14px;
}

/* ---------------- Lists ---------------- */

.list { display: flex; flex-direction: column; gap: 12px; }

.plain-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.plain-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.plain-list-item:last-child { border-bottom: none; }

.li-dot { font-size: 20px; flex: 0 0 auto; }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.li-title { font-weight: 700; font-size: 15px; }
.li-sub { font-size: 13px; color: var(--text-dim); }
.li-actions { display: flex; align-items: center; gap: 8px; }

.text-dim { color: var(--text-dim); }
.text-link { color: var(--accent); font-weight: 600; font-size: 14px; }
.danger-text { color: var(--danger); }

/* ---------------- Workout / history cards ---------------- */

.workout-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    margin-bottom: 0;
    transition: border-color .15s ease;
}
.workout-card:hover { border-color: var(--accent); }

.wc-main { display: flex; flex-direction: column; gap: 6px; }
.wc-date { font-weight: 800; font-size: 16px; }
.wc-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.wc-cat { font-size: 12.5px; color: var(--text-dim); }
.wc-meta { display: flex; gap: 6px; font-size: 13.5px; color: var(--text-dim); font-weight: 600; flex-wrap: wrap; }
.wc-chevron { position: absolute; right: 16px; top: 16px; color: var(--text-dim); font-size: 20px; }

.history-card { margin-bottom: 0; }
.hc-head { display: flex; justify-content: space-between; margin-bottom: 8px; }

.item-card { margin-bottom: 0; }
.item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.item-title { display: flex; gap: 10px; align-items: flex-start; }
.item-num {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--accent-soft);
    color: #9db8ff;
    font-weight: 800;
    font-size: 13px;
    margin-top: 2px;
}
.item-actions { display: flex; gap: 6px; }

.note-card {
    border-left: 3px solid var(--accent);
    color: var(--text-dim);
    font-size: 14px;
}

/* ---------------- Detail ---------------- */

.detail-card { padding: 18px; }
.detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.detail-head .page-title { font-size: 20px; }
.detail-desc { color: var(--text-dim); font-size: 14.5px; margin: 0 0 14px; }

.detail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 16px;
}
.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.detail-list dt { color: var(--text-dim); font-weight: 600; }
.detail-list dd { margin: 0; text-align: right; font-weight: 700; }

.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-actions .btn { flex: 1; }

/* ---------------- Filters ---------------- */

.filter-card { padding: 14px; }
.filter-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 12px;
}
.filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 16px;
}
.filter-actions .btn { flex: 1; }

/* ---------------- Quick links ---------------- */

.quick-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}
.quick-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    margin-bottom: 0;
    font-weight: 700;
}
.quick-link:hover { border-color: var(--accent); }
.ql-icon { font-size: 22px; }

/* ---------------- Segmented (metric toggle) ---------------- */

.segmented {
    display: flex;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
    gap: 4px;
    margin-bottom: 14px;
}
.seg-btn {
    flex: 1;
    min-height: 40px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-weight: 700;
    font-size: 14px;
    border-radius: 9px;
    cursor: pointer;
}
.seg-btn.is-active { background: var(--accent); color: #fff; }

/* ---------------- Chart ---------------- */

.chart-card { padding: 12px; }
.chart-wrap { position: relative; min-height: 240px; display: flex; align-items: center; justify-content: center; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-empty { color: var(--text-dim); font-size: 14px; }

/* ---------------- Records ---------------- */

.record-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 0;
}
.record-card:hover { border-color: var(--accent); }

.record-icon { font-size: 28px; flex: 0 0 auto; }
.record-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.record-name { font-weight: 800; font-size: 16px; }
.record-sub { font-size: 12.5px; }
.record-line { font-size: 15px; margin-top: 4px; }

/* ---------------- Sidebar (desktop) ---------------- */

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 264px;
    flex-direction: column;
    padding: 22px 16px;
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    z-index: 50;
}

.sidebar .brand { padding: 4px 8px 22px; }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dim);
}
.side-link:hover { background: var(--bg-elev-2); color: var(--text); }
.side-link.is-active { background: var(--accent-soft); color: #9db8ff; }

.side-icon { font-size: 18px; }

.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }

.side-user { display: flex; align-items: center; gap: 10px; padding: 10px 8px; }
.side-user-avatar {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    font-size: 16px;
}
.side-user-name { font-weight: 700; font-size: 14.5px; }

/* ---------------- Bottom nav (mobile) ---------------- */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: rgba(19, 20, 23, .96);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}

.bn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.bn-item.is-active { color: var(--accent); }
.bn-icon { font-size: 21px; }
.bn-label { font-size: 11px; }

/* ---------------- Drawer / hamburger menu (mobile) ---------------- */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, .55);
}

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    width: min(320px, 88vw);
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    padding: 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top));
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: slide-in-left .22s ease;
}

@keyframes slide-in-left {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}

.drawer[hidden], .overlay[hidden] { display: none; }

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

.drawer-title { font-weight: 800; font-size: 17px; }

.drawer-user { display: flex; align-items: center; gap: 12px; padding: 8px 0 16px; }
.drawer-user-name { font-weight: 800; }
.drawer-user-role { font-size: 13px; color: var(--text-dim); }

.drawer-nav { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }

.drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dim);
}
.drawer-link:hover { background: var(--bg-elev-2); color: var(--text); }
.drawer-link.is-active { background: var(--accent-soft); color: #9db8ff; }

/* ---------------- Toasts ---------------- */

.toast-stack {
    position: fixed;
    top: calc(14px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(92vw, 400px);
    pointer-events: none;
}

.toast {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    font-weight: 700;
    font-size: 14.5px;
    box-shadow: var(--shadow);
    animation: toast-in .25s ease;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.toast-success { border-left-color: var(--success); }
.toast-danger  { border-left-color: var(--danger); }
.toast-info    { border-left-color: var(--accent); }
.toast-pr      { border-left-color: var(--warning); border-color: rgba(245,166,35,.5); }

.toast.is-out { animation: toast-out .25s ease forwards; }
@keyframes toast-out {
    to { opacity: 0; transform: translateY(-8px); }
}

/* ---------------- Active workout pill ---------------- */

.active-workout-pill {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--accent-soft);
    color: #9db8ff;
    border: 1px solid rgba(47, 107, 255, .35);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
}

/* ---------------- Admin ---------------- */

.admin-link {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
    font-weight: 700;
}
.admin-link:hover { border-color: var(--accent); }
.admin-link small { font-weight: 500; }

/* ---------------- Login ---------------- */

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(900px 500px at 50% -10%, rgba(47, 107, 255, .18), transparent 60%),
        var(--bg);
    padding: 24px 16px;
}

.login-wrap { width: 100%; max-width: 380px; }

.login-brand { text-align: center; margin-bottom: 26px; }
.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    font-size: 38px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 14px;
}
.login-title { margin: 0; font-size: 30px; letter-spacing: -.5px; }
.login-subtitle { margin: 6px 0 0; color: var(--text-dim); font-size: 15.5px; letter-spacing: .3px; }

.login-logo-img {
    display: inline-block;
    width: 96px;
    height: 96px;
    object-fit: contain;
    padding: 6px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 16px;
}

.login-stock {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 7px 14px;
    font-size: 13px;
    color: var(--text-dim);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.login-stock b { color: var(--text); font-weight: 700; }
.login-stock-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent, #2dd4bf);
    flex-shrink: 0;
}

.login-domain {
    margin-top: 28px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-dim);
    letter-spacing: .4px;
}

.login-card { padding: 22px; }
.login-card .btn { margin-top: 6px; }
.login-hint { text-align: center; color: var(--text-dim); font-size: 13.5px; margin-top: 18px; }
.login-links { margin: 16px 0 0; text-align: center; }
.login-links a { color: var(--accent, #2dd4bf); text-decoration: none; font-weight: 600; letter-spacing: .3px; }
.login-hint strong { color: var(--text); }

/* ============================================================================
   RESPONSIVE
   ========================================================================== */

@media (min-width: 480px) {
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .ex-grid   { grid-template-columns: repeat(3, 1fr); }
    .quick-links { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) {
    .main-inner { padding: 28px 24px 140px; }
    .form-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-row { grid-template-columns: 1fr 1fr 1fr auto; align-items: flex-end; gap: 0 12px; }
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .ex-grid   { grid-template-columns: repeat(4, 1fr); }
    .set-actions { flex-direction: row; }
}

@media (min-width: 1024px) {
    .sidebar { display: flex; }
    .topbar { display: none; }
    .bottom-nav { display: none; }

    .app { display: flex; }
    .main {
        flex: 1;
        margin-left: 264px;
        min-height: 100vh;
    }
    .main-inner { padding: 40px 32px 80px; }

    .ex-grid { grid-template-columns: repeat(4, 1fr); }
    .stat-grid { grid-template-columns: repeat(5, 1fr); }

    .workout-bar {
        bottom: 20px;
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        width: min(720px, calc(100vw - 264px - 64px));
        margin: 0;
    }
    .sticky-actions {
        position: static;
        transform: none;
        width: auto;
        background: transparent;
        padding: 0;
    }
}

/* Doplňujúce komponenty */
.list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 12px;
}

.list-head-link {
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.set-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dot-sep {
    opacity: .5;
}

.summary-card {
    margin-bottom: 16px;
}

.side-logout {
    margin-top: 14px;
}

/* [hidden] musi vzdy vyhrat nad display:flex/.card, inak filter neukryje karty */
[hidden] {
    display: none !important;
}