.training-week-workspace { gap: 0; }
.week-heading { align-items: center; }
.week-navigation strong { min-width: 150px; color: #5e5a54; font-size: .7rem; text-align: center; }
.week-message { flex: 0 0 auto; margin-bottom: 9px; padding: 9px 12px; border: 1px solid #b9ceb5; border-radius: 9px; background: var(--cd-green-soft); color: #416044; font-size: .67rem; }
.week-message.error { border-color: #dfb6b8; background: var(--cd-red-soft); color: #7f3035; }
.week-message[hidden] { display: none; }

.week-process { display: grid; flex: 0 0 auto; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 9px; overflow: hidden; border: 1px solid var(--cd-border); border-radius: 10px; background: var(--cd-surface); }
.week-process-step { position: relative; display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 9px; min-height: 60px; padding: 8px 11px; border-left: 1px solid #eee5da; }
.week-process-step:first-child { border-left: 0; }
.week-process-step > span { grid-column: 1; color: #968e84; font-size: .49rem; font-weight: 770; letter-spacing: .06em; text-transform: uppercase; }
.week-process-step > strong { grid-column: 1; overflow: hidden; color: #5f5952; font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.week-process-step > small { grid-column: 1 / 3; color: var(--cd-muted); font-size: .5rem; }
.week-process-step > .training-action { grid-column: 2; grid-row: 1 / 3; min-height: 30px; padding: 6px 9px; font-size: .54rem; white-space: nowrap; }
.week-process-step.ready { background: var(--cd-orange-soft); }
.week-process-step.done > span { color: #668068; }
.week-process-step.done > strong::before { margin-right: 5px; color: var(--cd-green); content: "✓"; }
.week-process-step button:disabled { cursor: default; opacity: .48; }

.training-week-layout { display: grid; flex: 1; grid-template-columns: minmax(235px, .28fr) minmax(0, 1fr); min-height: 0; gap: 11px; overflow: hidden; }
.week-stock, .week-calendar { min-height: 0; overflow: hidden; border: 1px solid var(--cd-border); border-radius: var(--cd-radius); background: var(--cd-surface); box-shadow: 0 3px 14px rgba(76, 58, 36, .035); }
.week-stock { display: flex; flex-direction: column; }
.week-stock > header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; min-height: 58px; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #eee5da; }
.week-stock > header span { display: block; margin-bottom: 2px; color: #968e84; font-size: .52rem; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.week-stock > header h2 { margin: 0; font-size: .8rem; font-weight: 760; }
.week-stock > header > strong { display: grid; min-width: 27px; height: 27px; place-items: center; border-radius: 999px; background: #f1e9df; color: #71685e; font-size: .63rem; }
.week-stock-help { display: flex; flex: 0 0 auto; gap: 7px; padding: 9px 12px; border-bottom: 1px solid #eee5da; background: var(--cd-green-soft); color: #526955; font-size: .57rem; line-height: 1.4; }
.week-unplan-target { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; margin: 8px 10px 0; padding: 8px 9px; border: 1px dashed #d7c4b1; border-radius: 8px; color: #7c746b; font-size: .52rem; line-height: 1.35; transition: background 120ms ease, border-color 120ms ease; }
.week-unplan-target > i { color: var(--cd-orange-dark); font-size: .8rem; }
.week-unplan-target span { display: grid; gap: 1px; }
.week-unplan-target strong { color: #665f57; font-size: .55rem; }
.week-unplan-target.drag-over { border-color: var(--cd-orange); background: var(--cd-orange-soft); color: #75431f; }
.week-stock-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 8px; scrollbar-gutter: stable; }
.week-stock-card { position: relative; display: grid; width: 100%; gap: 3px; padding: 12px 25px 12px 0; border: 0; border-top: 1px solid #eee5da; background: transparent; color: var(--cd-text); font: inherit; text-align: left; cursor: grab; }
.week-stock-card:first-child { border-top: 0; }
.week-stock-card:active { cursor: grabbing; }
.week-stock-card > span { color: var(--cd-orange-dark); font-size: .5rem; font-weight: 730; text-transform: uppercase; }
.week-stock-card > strong { font-size: .68rem; }
.week-stock-card > small { color: var(--cd-muted); font-size: .56rem; }
.week-stock-card > i { position: absolute; top: 50%; right: 2px; color: #aaa197; transform: translateY(-50%); }
.week-stock-card.selected { margin: 5px 0; padding-left: 8px; border: 1px solid #d3a37e; border-radius: 9px; background: var(--cd-orange-soft); }
.week-stock-empty { display: grid; height: 100%; place-content: center; justify-items: center; gap: 7px; padding: 20px; color: var(--cd-muted); text-align: center; }
.week-stock-empty i { color: var(--cd-green); font-size: 1.5rem; }
.week-stock-empty strong { color: #5d615c; font-size: .72rem; }
.week-stock-empty span { font-size: .6rem; line-height: 1.4; }
.week-stock-empty .training-action { margin-top: 5px; }
.week-stock > footer { flex: 0 0 auto; padding: 10px 12px; border-top: 1px solid #eee5da; }
.week-stock > footer a { display: flex; align-items: center; gap: 6px; color: #665f57; font-size: .61rem; font-weight: 710; text-decoration: none; }

.week-calendar { display: grid; grid-template-columns: repeat(7, minmax(102px, 1fr)); overflow-x: auto; scrollbar-gutter: stable; }
.week-day { display: flex; min-width: 102px; min-height: 0; flex-direction: column; border-left: 1px solid #eee5da; background: #fffdf9; transition: background 120ms ease, box-shadow 120ms ease; }
.week-day:first-child { border-left: 0; }
.week-day > header { display: grid; flex: 0 0 auto; grid-template-columns: 1fr auto; gap: 1px 5px; min-height: 67px; padding: 10px; border-bottom: 1px solid #eee5da; }
.week-day > header span { grid-column: 1; color: var(--cd-muted); font-size: .54rem; font-weight: 730; text-transform: uppercase; }
.week-day > header strong { grid-column: 1; font-size: 1rem; line-height: 1; }
.week-day > header small { grid-column: 2; grid-row: 1 / 3; align-self: center; color: #9a9289; font-size: .52rem; }
.week-day.today > header { background: var(--cd-orange-soft); }
.week-day.today > header strong { color: var(--cd-orange-dark); }
.week-day-block { display: flex; flex: 0 0 auto; align-items: center; min-height: 35px; gap: 5px; padding: 7px 9px; border-bottom: 1px solid #eee5da; background: #f3ece3; color: #6e675f; font-size: .5rem; }
.week-day-block span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-day-sessions { display: grid; flex: 1; min-height: 0; align-content: start; gap: 7px; overflow-y: auto; overscroll-behavior: contain; padding: 8px; scrollbar-gutter: stable; }
.week-session-card { display: grid; gap: 3px; padding: 9px; border: 1px solid #dfd2c4; border-radius: 9px; background: var(--cd-surface); color: var(--cd-text); text-decoration: none; box-shadow: 0 2px 6px rgba(76, 58, 36, .04); }
.week-session-card > span { color: var(--cd-orange-dark); font-size: .47rem; font-weight: 730; text-transform: uppercase; }
.week-session-card > strong { font-size: .61rem; line-height: 1.25; }
.week-session-card > small { color: var(--cd-muted); font-size: .49rem; line-height: 1.3; }
.week-polar-summary { width: fit-content; margin-top: 2px; padding: 2px 5px; border-radius: 999px; background: #eee8df; color: #70685f; font-size: .47rem; font-style: normal; font-weight: 730; }
.week-polar-summary.completed { background: var(--cd-green-soft); color: #416044; }
.week-polar-summary.partial, .week-polar-summary.missed { background: var(--cd-red-soft); color: #7f3035; }
.week-polar-summary.published { background: var(--cd-orange-soft); color: var(--cd-orange-dark); }
.week-exercise-status { display: grid; gap: 3px; margin: 3px 0 0; padding: 5px 0 0; border-top: 1px solid #eee5da; list-style: none; }
.week-exercise-status li { display: flex; min-width: 0; align-items: center; gap: 4px; color: #827970; font-size: .46rem; }
.week-exercise-status li span { display: grid; min-width: 0; gap: 1px; overflow: hidden; text-overflow: ellipsis; }
.week-exercise-status li small { color: var(--cd-muted); font-size: .43rem; white-space: normal; }
.week-exercise-status li.completed { color: #4d704f; }
.week-exercise-status li.missed, .week-exercise-status li.overdue, .week-exercise-status li.publication_failed { color: #934247; }
.week-session-status.approved::before { display: inline-block; width: 6px; height: 6px; margin: 0 4px 1px 0; border-radius: 50%; background: var(--cd-green); content: ""; }
.week-session-card.draggable { cursor: grab; }
.week-session-card.draggable:active { cursor: grabbing; }
.week-day-drop { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; min-height: 38px; gap: 5px; margin: 0 8px 8px; border: 1px dashed #d7c4b1; border-radius: 8px; background: transparent; color: #8a8177; font: inherit; font-size: .53rem; font-weight: 700; cursor: pointer; }
.week-day-drop:hover, .week-day.drag-over .week-day-drop { border-color: var(--cd-orange); background: var(--cd-orange-soft); color: #7e411a; }
.week-day.drag-over { background: #fff8f0; box-shadow: inset 0 0 0 2px var(--cd-orange); }
.week-day.unavailable { background: #f2ede6; opacity: .65; }
.week-day-closed { display: grid; flex: 0 0 38px; place-items: center; margin: 0 8px 8px; color: #aaa197; }

@media (max-width: 1050px) {
    .training-week-layout { grid-template-columns: 220px minmax(0, 1fr); }
    .week-calendar { grid-template-columns: repeat(7, minmax(112px, 1fr)); }
}

@media (max-width: 760px) {
    .training-workspace-screen { height: 100dvh; overflow: hidden; }
    .training-workspace-screen .app-shell, .training-workspace-screen .app-workspace { height: 100dvh; min-height: 0; overflow: hidden; }
    .training-workspace-screen .app-content { height: calc(100dvh - 68px); overflow: hidden; }
    .training-week-layout { display: grid; grid-template-columns: minmax(190px, .38fr) minmax(0, 1fr); overflow: hidden; }
    .week-stock, .week-calendar { min-height: 0; }
    .week-navigation { flex-wrap: wrap; }
    .week-process-step { padding: 7px 8px; }
    .week-process-step > small { display: none; }
    .week-process-step > .training-action { padding: 5px 7px; font-size: .5rem; }
}
