/* Wartaverket – app/static/style.css */

/* Warta design tokens */
:root {
    --warta-black: #111111;
    --warta-ink: #202020;
    --warta-muted: #686868;
    --warta-line: #ddddda;
    --warta-surface: #ffffff;
    --warta-canvas: #f4f4f1;
    --warta-soft: #eeeeeb;
    --warta-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* Base */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    background: var(--warta-canvas);
    color: var(--warta-ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--warta-black); }

/* Navigation */
nav {
    background: rgba(255,255,255,0.96);
    color: var(--warta-black);
    padding: 0.65rem max(1rem, calc((100vw - 1400px) / 2));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--warta-line);
    box-shadow: 0 4px 18px rgba(0,0,0,0.035);
    backdrop-filter: blur(12px);
}
nav .brand {
    display: flex;
    flex: 0 0 auto;
    width: 142px;
    padding-left: 1.1rem;
    border-left: 1px solid var(--warta-line);
}
nav .brand img { display: block; width: 100%; height: auto; }
.nav-primary,
.nav-tools { display: flex; align-items: center; gap: 0.3rem; }
.nav-tools { justify-content: flex-end; margin-left: auto; }
.global-save-status {
    display: none;
    padding: 0.25rem 0.55rem;
    color: #267044;
    background: #f0f8f2;
    border: 1px solid #d8e4db;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.global-save-status.is-visible { display: inline-block; }
.global-save-status.is-saving { color: #8a6915; background: #fff8e5; border-color: #ead9a2; }
nav a {
    color: var(--warta-ink);
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 650;
    text-decoration: none;
}
nav a:hover { background: var(--warta-soft); text-decoration: none; }
nav .brand:hover { background: transparent; }
nav .nav-user {
    max-width: 160px;
    overflow: hidden;
    color: var(--warta-muted);
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-version {
    color: var(--warta-muted);
    font-size: 0.72rem;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.nav-logout { color: var(--warta-muted); }

/* Admin dropdown */
.dropdown { position: relative; display: inline-block; }
.dropdown-btn {
    background: none;
    border: 1px solid transparent;
    color: var(--warta-ink);
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 650;
}
.dropdown-btn:hover { background: var(--warta-soft); border-color: transparent; }
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    min-width: 190px;
    overflow: hidden;
    background: white;
    border: 1px solid var(--warta-line);
    border-radius: 10px;
    box-shadow: 0 14px 35px rgba(0,0,0,0.14);
    z-index: 200;
}
.dropdown-content a {
    display: block;
    padding: 0.6rem 0.85rem;
    color: var(--warta-ink);
    border-radius: 0;
    text-decoration: none;
    font-size: 0.82rem;
}
.dropdown-content a:hover { background: var(--warta-soft); }
.dropdown-content.show { display: block; }
.nav-language .dropdown-btn {
    color: var(--warta-muted);
    border-color: var(--warta-line);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

/* Container */
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 1.5rem; flex: 1; }
.container-wide { width: 100%; max-width: 1440px; margin: 0 auto; padding: 1.5rem; flex: 1; }
.app-content { animation: app-content-in 0.18s ease-out; }
@keyframes app-content-in {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typography */
h1 {
    margin-bottom: 1rem;
    color: var(--warta-black);
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    line-height: 1.2;
    letter-spacing: -0.025em;
}
h2 { margin: 1.25rem 0 0.55rem; color: var(--warta-ink); font-size: 1.2rem; }
h3 { margin: 0.85rem 0 0.3rem; color: #343434; font-size: 1rem; }

/* Cards */
.card {
    background: var(--warta-surface);
    border: 1px solid var(--warta-line);
    border-radius: 14px;
    padding: 1rem 1.15rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 5px 18px rgba(0,0,0,0.035);
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; gap: 1.5rem; }
.card-header:last-child { margin-bottom: 0; }
.card-clickable {
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.card-clickable:hover {
    border-color: #b7b7b2;
    box-shadow: var(--warta-shadow);
    transform: translateY(-1px);
}

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.68rem; font-weight: bold; text-transform: uppercase; }
.badge-published { background: #27ae60; color: white; }
.badge-draft { background: #f39c12; color: white; }
.badge-changes { background: #e74c3c; color: white; }
.badge-shared { background: var(--warta-black); color: white; }
.badge-private { background: #e8e8e5; color: #454545; }
.badge-archived { background: #6b6b68; color: white; }
.card-archived { opacity: 0.6; background: #f5f5f5; border-left: 3px solid #7f8c8d; }
.level-badge { background: #e7e7e3; color: #333; padding: 2px 6px; border-radius: 999px; font-size: 0.75rem; }

/* Forms */
label { display: block; font-size: 0.8rem; font-weight: 650; color: #515151; margin-bottom: 0.3rem; }
input, textarea, select {
    width: 100%;
    padding: 0.6rem 0.7rem;
    margin-bottom: 0.75rem;
    background: white;
    border: 1px solid #d2d2ce;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--warta-black);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}
textarea { min-height: 80px; resize: vertical; }
input[type="number"] { width: auto; min-width: 80px; }

/* Inline form */
.form-row { display: flex; gap: 0.75rem; align-items: flex-end; }
.form-row > * { flex: 1; }
.form-row .form-narrow { flex: 0 0 100px; }

/* Buttons */
button, .btn {
    padding: 0.5rem 1.05rem;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 650;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
    line-height: 1.4;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:active, button:active { transform: translateY(1px); }
.btn:disabled, button:disabled { cursor: not-allowed; opacity: 0.45; transform: none; }
.btn-primary { background: var(--warta-black); color: white; }
.btn-primary:hover { background: #333; }
.btn-success { background: #27ae60; color: white; }
.btn-success:hover { background: #219a52; }
.btn-danger { background: #e74c3c; color: white; }
.btn-danger:hover { background: #c0392b; }
.btn-warning { color: #856404; border-color: #856404; }
.btn-warning:hover { background: #856404; color: white; }
.card-archived { opacity: 0.6; border-left: 3px solid #6c757d; }
.status-badge { font-size: 0.8rem; margin-left: 0.25rem; }
.status-archived { color: #6c757d; }
.btn-secondary { background: #e8e8e5; color: #333; }
.btn-secondary:hover { background: #d8d8d4; }
.btn-outline { background: white; border: 1px solid #cfcfca; color: #2a2a2a; }
.btn-outline:hover { border-color: var(--warta-black); color: var(--warta-black); background: #f7f7f5; }
.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.8rem; }
.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Tables */
table { width: 100%; overflow: hidden; border-collapse: collapse; background: white; border-radius: 10px; }
th, td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid #ecece8; }
th { background: #f1f1ee; font-size: 0.72rem; color: #60605d; text-transform: uppercase; letter-spacing: 0.6px; }
tr:hover { background: #f8f8f6; }

/* Lists */
.item-list { list-style: none; }
.item-list li { padding: 0.75rem 0; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.item-list li:last-child { border-bottom: none; }

/* Flash messages */
.flash { padding: 0.75rem 1rem; border-radius: 4px; margin-bottom: 1rem; font-size: 0.9rem; }
.flash-error { background: #fde8e8; color: #c0392b; border: 1px solid #f5c6cb; }
.flash-success { background: #d4efdf; color: #1e8449; border: 1px solid #a9dfbf; }
.flash-info { background: #efefec; color: #333; border: 1px solid #d3d3cf; }

/* Login */
.login-form { max-width: 430px; margin: clamp(2rem, 8vh, 6rem) auto; }
.login-card { padding: 2rem; border-radius: 18px; box-shadow: var(--warta-shadow); }
.login-logo { display: block; width: min(270px, 80%); height: auto; margin: 0 auto 1.2rem; }
.login-tagline { margin-bottom: 1.5rem; color: var(--warta-muted); text-align: center; }

/* Shared page composition */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.page-header h1 { margin-bottom: 0.2rem; }
.page-header p,
.page-intro { color: var(--warta-muted); }
.page-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 0.8rem;
}
.content-grid .card { height: 100%; margin: 0; }
.entity-card-title { color: var(--warta-black); font-size: 1rem; font-weight: 750; }
.entity-card-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    color: var(--warta-muted);
    font-size: 0.78rem;
}
.home-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(2rem, 7vw, 5rem);
    color: white;
    background: #111;
    border-radius: 20px;
    box-shadow: 0 18px 45px rgba(0,0,0,0.14);
}
.home-hero::after {
    content: "W";
    position: absolute;
    right: -0.04em;
    bottom: -0.44em;
    color: rgba(255,255,255,0.055);
    font-size: clamp(13rem, 36vw, 27rem);
    font-weight: 900;
    line-height: 1;
}
.home-hero > * { position: relative; z-index: 1; }
.home-hero h1 { max-width: 700px; color: white; font-size: clamp(2.3rem, 7vw, 4.8rem); }
.home-hero p { max-width: 560px; color: #c9c9c5; font-size: 1.15rem; }
.home-quicklinks {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-top: 1rem;
}
.home-quicklink {
    padding: 1.2rem;
    background: white;
    border: 1px solid var(--warta-line);
    border-radius: 14px;
    color: var(--warta-ink);
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}
.home-quicklink:hover { box-shadow: var(--warta-shadow); transform: translateY(-2px); }
.home-quicklink span {
    display: block;
    margin-bottom: 0.2rem;
    color: #8a8a86;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.home-quicklink strong { font-size: 1.05rem; }

/* Duration indicator */
.duration-bar { display: flex; align-items: center; gap: 0.5rem; margin: 0.5rem 0; }
.duration-bar .bar { flex: 1; height: 6px; background: #eee; border-radius: 3px; overflow: hidden; }
.duration-bar .bar-fill { height: 100%; background: #27ae60; border-radius: 3px; transition: width 0.3s; }
.duration-bar .bar-fill.over { background: #e74c3c; }
.duration-text { font-size: 0.85rem; color: #666; white-space: nowrap; }

/* Training-session builder */
.session-builder {
    --builder-ink: #202020;
    --builder-muted: #70706d;
    --builder-line: #d8d8d4;
    --builder-panel: #fff;
    --builder-accent: #111;
    --builder-accent-soft: #ecece8;
    padding-bottom: 3rem;
}
.session-back-link {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    margin: 0.25rem 0 1rem;
    color: var(--builder-muted);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}
.session-back-link:hover { color: var(--builder-accent); }
.session-hero {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    align-items: center;
    padding: 1.6rem 1.75rem;
    margin-bottom: 1rem;
    color: white;
    background:
        radial-gradient(circle at 88% 15%, rgba(255,255,255,0.14), transparent 28%),
        linear-gradient(125deg, #0a0a0a 0%, #242424 60%, #3a3a3a 100%);
    border-radius: 18px;
    box-shadow: 0 14px 35px rgba(21, 59, 85, 0.18);
}
.session-hero h1 {
    color: white;
    font-size: clamp(1.65rem, 4vw, 2.35rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin: 0.15rem 0 0.65rem;
}
.session-eyebrow {
    color: rgba(255,255,255,0.68);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.session-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.session-hero .badge {
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
}
.session-hero .badge-changes { background: #d94f45; border-color: transparent; }
.session-duration-summary {
    flex: 0 0 210px;
    padding: 0.85rem 1rem;
    background: rgba(255,255,255,0.11);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    backdrop-filter: blur(4px);
}
.session-duration-summary .duration-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.25rem;
    margin: 0;
}
.duration-summary-value {
    font-size: 1.65rem;
    font-weight: 750;
    line-height: 1;
}
.duration-summary-value span { font-size: 0.8rem; font-weight: 600; opacity: 0.75; }
.session-duration-summary .duration-text { color: rgba(255,255,255,0.72); }
.session-duration-summary .bar { background: rgba(255,255,255,0.18); margin-top: 0.3rem; }
.session-duration-summary .bar-fill { background: #65d69a; }

.session-details-card {
    margin-bottom: 1rem;
    padding: 1rem 1.2rem;
    background: rgba(255,255,255,0.74);
    border: 1px solid #e1e9ed;
    border-radius: 14px;
    box-shadow: 0 5px 18px rgba(33, 62, 79, 0.06);
}
.session-save-notice {
    position: sticky;
    top: 0.5rem;
    z-index: 15;
    display: flex;
    justify-content: flex-end;
    min-height: 1.8rem;
    margin: -0.35rem 0 0.35rem;
    pointer-events: none;
}
.session-save-notice .save-status {
    padding: 0.28rem 0.65rem;
    background: rgba(255,255,255,0.94);
    border: 1px solid #d8e4db;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    pointer-events: auto;
}
.session-details-header,
.session-save-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}
.save-status {
    color: #267044;
    font-size: 0.8rem;
    font-weight: 700;
}
.save-status.is-saving { color: #8a6915; }
.save-status.is-hidden { display: none; }
.session-details-header h2 {
    margin: 0;
    font-size: 0.88rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.session-details-fields {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
    gap: 1rem;
    margin-top: 0.75rem;
}
.session-details-fields input,
.session-details-fields textarea {
    margin-bottom: 0;
    background: white;
}
.session-details-fields textarea { min-height: 42px; height: 42px; }

.session-timeline { position: relative; margin-top: 1.5rem; }
.session-timeline::before {
    content: "";
    position: absolute;
    top: 1.5rem;
    bottom: 1rem;
    left: 3.2rem;
    width: 2px;
    background: var(--builder-line);
}
.session-block {
    position: relative;
    display: grid;
    grid-template-columns: 4.8rem minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 1.4rem;
}
.session-block-marker {
    position: relative;
    padding-top: 1.45rem;
    color: var(--builder-muted);
    font-size: 0.76rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.session-block-marker i {
    position: absolute;
    top: 1.48rem;
    right: -1.48rem;
    width: 12px;
    height: 12px;
    background: white;
    border: 3px solid var(--builder-accent);
    border-radius: 50%;
    box-shadow: 0 0 0 4px #f5f5f5;
}
.session-block-card {
    min-width: 0;
    overflow: hidden;
    background: var(--builder-panel);
    border: 1px solid #dfe8ec;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(33, 62, 79, 0.07);
}
.session-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.15rem;
    background: linear-gradient(180deg, #fff, #f9fbfc);
    border-bottom: 1px solid #e7eef1;
}
.session-block-heading { min-width: 0; flex: 1; }
.session-block-number {
    display: block;
    margin-bottom: 0.15rem;
    color: #79909e;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}
.session-block-heading h2 { margin: 0; color: var(--builder-ink); }
.block-name-input,
.track-name-input {
    margin: 0;
    padding: 0.1rem 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid transparent;
    border-radius: 0;
    color: var(--builder-ink);
    font-weight: 700;
}
.block-name-input { max-width: 34rem; font-size: 1.15rem; }
.track-name-input { font-size: 0.98rem; }
.block-name-input:hover,
.track-name-input:hover { border-bottom-color: #c5d4db; }
.block-name-input:focus,
.track-name-input:focus {
    border-bottom-color: var(--builder-accent);
    box-shadow: none;
}
.session-block-tools,
.session-track-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.session-minutes-field {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    padding: 0.3rem 0.55rem;
    color: var(--builder-muted);
    background: #edf3f6;
    border-radius: 999px;
}
.session-minutes-field input {
    width: 3.5rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--builder-ink);
    font-weight: 750;
    text-align: right;
}
.session-minutes-field span { font-size: 0.75rem; }
.session-block-duration {
    padding: 0.3rem 0.65rem;
    color: var(--builder-muted);
    background: #edf3f6;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}
.session-icon-button {
    display: inline-grid;
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    place-items: center;
    color: #8b9aa4;
    background: transparent;
    border-radius: 50%;
    font-size: 0.75rem;
}
.session-icon-button:hover { background: #eaf0f3; color: #3f5665; }
.session-icon-button-danger:hover { background: #fdecea; color: #c0392b; }

.block-tracks {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 1rem;
    background: #f3f7f9;
}
.block-tracks.has-parallel-tracks {
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 0.9rem;
}
.session-track {
    min-width: 0;
    padding: 0.9rem;
    background: white;
    border: 1px solid #dfe8ec;
    border-radius: 12px;
}
.block-tracks:not(.has-parallel-tracks) .session-track {
    padding: 0;
    border: 0;
}
.session-track-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.2rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #e8eef1;
}
.session-track-name { color: var(--builder-ink); }
.session-track-time {
    flex: none;
    padding: 0.2rem 0.5rem;
    color: #333;
    background: var(--builder-accent-soft);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 750;
    white-space: nowrap;
}
.session-track-time.is-under { color: #8a6915; background: #fff5d9; }
.session-track-time.is-over { color: #a43b36; background: #fdebea; }

.session-section {
    overflow: hidden;
    margin-top: 0.8rem;
    background: white;
    border: 1px solid #e1e9ed;
    border-radius: 10px;
}
.block-tracks:not(.has-parallel-tracks) .session-section { border-color: #dce6eb; }
.session-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.7rem;
    background: #f7fafb;
    border-bottom: 1px solid #e8eef1;
}
.session-section-label {
    color: #444;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}
.session-section-time {
    margin-left: 0.4rem;
    color: #8a9aa4;
    font-size: 0.72rem;
    font-weight: 650;
}
.session-exercise-list { padding: 0.2rem 0.7rem; }
.session-exercise {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.65rem;
    min-height: 2.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid #edf1f3;
}
.session-exercise:last-child { border-bottom: 0; }
.session-exercise .exercise-name {
    display: flex;
    flex: 1;
    gap: 0.55rem;
    align-items: center;
    min-width: 0;
    color: #263e4d;
    font-weight: 600;
}
.session-builder .level-badge {
    flex: none;
    min-width: 1.7rem;
    padding: 0.15rem 0.4rem;
    background: #e7e7e3;
    color: #333;
    border-radius: 999px;
    font-size: 0.68rem;
    text-align: center;
}
.session-exercise .exercise-time {
    width: auto;
    flex: none;
    color: var(--builder-muted);
    font-size: 0.8rem;
    text-align: right;
    white-space: nowrap;
}
.session-exercise .exercise-time-input {
    min-width: 0;
    margin: 0;
    background: #f6f9fa;
    border-color: #dfe8ec;
    border-radius: 6px;
}
.session-add-row {
    width: 100%;
    padding: 0.55rem 0.7rem;
    color: #66808f;
    background: transparent;
    border-top: 1px dashed #d5e0e5;
    border-radius: 0;
    font-size: 0.78rem;
    font-weight: 650;
    text-align: left;
}
.session-add-row:hover { color: var(--builder-accent); background: #f5fafc; }
.session-add-section {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    margin-top: 0.8rem;
}
.session-add-section select { min-width: 0; margin: 0; background: #f8fafb; }
.session-add-section .btn { flex: none; }
.session-block-footer {
    padding: 0 1rem 1rem;
    background: #f3f7f9;
}
.session-add-block {
    margin: 0 0 1rem 5.8rem;
    padding: 0.8rem;
    text-align: center;
    border: 1px dashed #bdccd4;
    border-radius: 12px;
}
.session-add-block:hover { background: rgba(255,255,255,0.55); }

@media (max-width: 720px) {
    .session-hero { align-items: stretch; flex-direction: column; gap: 1rem; padding: 1.25rem; }
    .session-duration-summary { flex-basis: auto; }
    .session-details-fields { grid-template-columns: 1fr; }
    .session-timeline::before { left: 0.38rem; }
    .session-block { grid-template-columns: minmax(0, 1fr); padding-left: 1.35rem; }
    .session-block-marker {
        position: absolute;
        top: 1.55rem;
        left: -0.3rem;
        z-index: 2;
        padding: 0;
        text-align: left;
    }
    .session-block-marker span { display: none; }
    .session-block-marker i { top: 0; right: auto; left: 0; }
    .session-block-header { align-items: flex-start; }
    .session-block-tools { align-items: flex-end; flex-direction: column; }
    .block-tracks.has-parallel-tracks { grid-template-columns: 1fr; }
    .session-track-header { align-items: flex-start; }
    .session-exercise { flex-wrap: wrap; }
    .session-exercise .exercise-name { flex-basis: calc(100% - 2.5rem); }
    .session-add-section { align-items: stretch; flex-direction: column; }
    .session-add-section select, .session-add-section .btn { width: 100% !important; }
    .session-add-block { margin-left: 1.35rem; }
}

/* Footer */
footer { background: #111; padding: 1rem 2rem; text-align: center; font-size: 0.78rem; color: #aaa; border-top: 1px solid #222; }
footer a { color: white; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: #999; }
.empty-state p { margin-bottom: 1rem; }

/* Dirty state indicator */
.dirty-indicator { color: #f39c12; font-size: 0.8rem; font-weight: bold; }

/* Confirm dialog */
.confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }

/* Reusable Warta modal */
.warta-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.45);
    display: none; align-items: center; justify-content: center; z-index: 2000;
}
.warta-modal-overlay.show { display: flex; }
.warta-modal {
    background: #fff; border-radius: 14px; max-width: 460px; width: 92%;
    border: 1px solid #d8d8d4;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25); overflow: hidden;
    animation: warta-modal-in 0.12s ease-out;
}
@keyframes warta-modal-in { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.warta-modal-header { padding: 1rem 1.25rem 0.25rem; }
.warta-modal-title { font-size: 1.1rem; font-weight: 700; color: #111; margin: 0; }
.warta-modal-body { padding: 0.5rem 1.25rem 1rem; color: #444; }
.warta-modal-input {
    width: 100%; margin-top: 0.25rem; padding: 0.5rem 0.6rem;
    border: 1px solid #ccc; border-radius: 6px; font-size: 0.95rem;
}
.warta-modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; padding: 0.75rem 1.25rem 1.1rem; }

/* Password confirm mismatch state */
input.pw-mismatch { border: 2px solid #e74c3c; background: #fdecea; }
.quick-filter { border: 1px solid #ccc; border-radius: 6px; font-size: 0.95rem; }
.card-needs-decision { border-left: 4px solid #e74c3c; }

/* Markdown-lite: editorial content + formatting toolbar (D023) */
.md-content { white-space: normal; }
.md-content p { margin: 0 0 0.5rem; }
.md-content p:last-child { margin-bottom: 0; }
.md-content ul { margin: 0 0 0.5rem 1.25rem; }
.md-toolbar { display: flex; gap: 0.3rem; margin: 0.2rem 0; }
.md-toolbar-btn { padding: 0.1rem 0.5rem; font-size: 0.8rem; min-width: 2rem; }
.confirm-box { background: white; border-radius: 8px; padding: 2rem; max-width: 500px; width: 90%; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.confirm-box h3 { margin-bottom: 1rem; }
.confirm-box .btn-group { margin-top: 1.5rem; justify-content: flex-end; }

/* Drag and drop */
.sortable-ghost { opacity: 0.4; background: #e2e2de; }
.drag-handle { cursor: grab; color: #bbb; font-size: 1.2rem; user-select: none; }
.drag-handle:hover { color: #666; }
.drag-handle:active { cursor: grabbing; }

/* User search autocomplete */
.user-search-wrapper { position: relative; }
.user-search-wrapper input[type="search"] { margin-bottom: 0; }
.user-search-results { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid #ddd; border-top: none; border-radius: 0 0 4px 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); list-style: none; max-height: 240px; overflow-y: auto; z-index: 300; }
.user-search-item { padding: 0.5rem 0.75rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f0f0f0; }
.user-search-item:last-child { border-bottom: none; }
.user-search-item:hover { background: #eeeeeb; }
.user-search-name { font-weight: 500; font-size: 0.9rem; }
.user-search-email { font-size: 0.8rem; color: #666; }
.user-search-selected { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.75rem; background: #d4efdf; border-radius: 4px; font-size: 0.9rem; margin-bottom: 0.5rem; }
.user-search-selected .remove-selected { cursor: pointer; color: #c0392b; font-weight: bold; margin-left: 0.5rem; }

/* Notification bell */
.nav-bell { position: relative; font-size: 1.1rem; text-decoration: none !important; }
.notification-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    font-size: 0.65rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Notification list */
.notification-list { list-style: none; padding: 0; }
.notification-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    background: white;
}
.notification-item:first-child { border-radius: 6px 6px 0 0; }
.notification-item:last-child { border-radius: 0 0 6px 6px; border-bottom: none; }
.notification-unread { background: #eeeeeb; }
.notification-icon { font-size: 1.3rem; }
.notification-content { flex: 1; }
.notification-message a { color: #111; font-weight: 650; text-decoration: none; }
.notification-message a:hover { text-decoration: underline; }
.notification-time { font-size: 0.8rem; color: #888; margin-top: 0.2rem; }
.notification-action button { background: #28a745; color: white; border: none; border-radius: 4px; padding: 0.3rem 0.6rem; cursor: pointer; font-size: 0.8rem; }
.notification-action button:hover { background: #218838; }
.active-filter { font-weight: bold; text-decoration: underline; }
.empty-state { color: #888; text-align: center; padding: 2rem; }

/* Updated exercises badge in session list */
.badge-updated {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Session update banner */
.update-banner {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    margin: 0.75rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}
.exercise-has-update {
    border-left: 3px solid #ffc107;
    background: #fffdf5;
}

/* Version diff table */
.version-diff {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #fefefe;
    border: 1px solid #eee;
    border-radius: 4px;
    width: 100%;
}
.diff-table { width: 100%; font-size: 0.8rem; border-collapse: collapse; }
.diff-table th { text-align: left; padding: 0.3rem 0.5rem; border-bottom: 1px solid #ddd; color: #666; font-size: 0.75rem; }
.diff-table td { padding: 0.3rem 0.5rem; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.diff-old { color: #999; text-decoration: line-through; }
.diff-new { color: #155724; font-weight: 500; }

@media (max-width: 900px) {
    nav { align-items: flex-start; flex-wrap: wrap; }
    .nav-primary { order: 2; width: 100%; overflow-x: auto; padding-top: 0.35rem; border-top: 1px solid var(--warta-line); }
    .nav-tools { order: 1; width: 100%; }
    nav .brand { margin-left: auto; }
}

@media (max-width: 640px) {
    .container, .container-wide { padding: 1rem; }
    nav { padding: 0.55rem 0.75rem; }
    nav .brand { width: 118px; }
    nav .nav-user { display: none; }
    nav a, .dropdown-btn { padding: 0.4rem 0.5rem; font-size: 0.78rem; white-space: nowrap; }
    .page-header { align-items: stretch; flex-direction: column; }
    .page-actions .btn { flex: 1; text-align: center; }
    .card-header { align-items: flex-start; flex-direction: column; gap: 0.65rem; }
    .home-quicklinks { grid-template-columns: 1fr; }
}
