:root {
    --bg: #dbdbd9;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-strong: #f4f3f1;
    --line: rgba(153, 54, 43, 0.18);
    --text: #111111;
    --muted: #575757;
    --accent: #99362b;
    --accent-dark: #6f261f;
    --accent-soft: rgba(153, 54, 43, 0.1);
    --success: #2c6a4b;
    --error: #9b2d30;
    --shell-gap: 24px;
    --sidebar-width: 280px;
    --radius-panel: 22px;
    --radius-card: 18px;
    --radius-control: 14px;
    --shadow-panel: 0 18px 40px rgba(17, 17, 17, 0.08);
    --shadow-button: 0 12px 24px rgba(111, 38, 31, 0.18);
    --shadow-soft: 0 8px 18px rgba(17, 17, 17, 0.08);
    --font-sans: "Trebuchet MS", "Segoe UI", sans-serif;
    --heading-tight: 1.08;
    --body-size: 0.97rem;
    --body-leading: 1.45;
    --label-size: 0.9rem;
    --helper-size: 0.88rem;
    --control-height: 46px;
    --button-height: 42px;
    --action-height: 40px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--body-size);
    line-height: var(--body-leading);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(153, 54, 43, 0.18) 0%, transparent 32%),
        linear-gradient(135deg, #efefed 0%, var(--bg) 50%, #d2d2cf 100%);
}

.shell {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
    position: relative;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30;
    width: min(var(--sidebar-width), calc(100vw - 32px));
    height: 100vh;
    padding: 28px 22px;
    background:
        linear-gradient(180deg, rgba(153, 54, 43, 0.98) 0%, rgba(111, 38, 31, 0.98) 100%);
    color: #f7f4f2;
    box-shadow: 24px 0 50px rgba(19, 19, 19, 0.18);
    transform: translateX(-100%);
    transition: transform 0.24s ease, box-shadow 0.24s ease;
    overflow-y: auto;
}

body.menu-open .sidebar {
    transform: translateX(0);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 28px;
}

.sidebar h1 {
    margin: 0;
    font-size: 1.45rem;
    line-height: var(--heading-tight);
    letter-spacing: -0.02em;
}

.sidebar-badge {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar nav {
    display: grid;
    gap: 10px;
}

.sidebar a {
    display: flex;
    align-items: center;
    min-height: var(--control-height);
    padding: 10px 14px;
    border-radius: 14px;
    color: inherit;
    text-decoration: none;
    opacity: 0.92;
    background: rgba(255, 255, 255, 0.04);
    font-weight: 700;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.sidebar a:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(2px);
}

.sidebar a.is-active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    border: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
}

body.menu-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.main {
    padding: 82px var(--shell-gap) var(--shell-gap);
    width: 100%;
}

.main-toolbar {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.toolbar-title {
    display: none;
}

.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(153, 54, 43, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 12px 28px rgba(17, 17, 17, 0.08);
    -webkit-appearance: none;
    appearance: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.menu-toggle-icon {
    width: 22px;
    height: 22px;
    display: block;
}

.menu-toggle-icon path {
    fill: none;
    stroke: var(--accent);
    stroke-linecap: round;
    stroke-width: 2.2;
}

body.menu-open .main-toolbar {
    pointer-events: none;
}

body.menu-open .menu-toggle {
    opacity: 0;
    transform: scale(0.9);
}

.page-header,
.stats-grid,
.panel-grid {
    margin-bottom: 18px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-end;
}

.page-header h2,
.panel h3,
.stat-card h3,
.week-column h4 {
    margin: 0;
}

.page-header p,
.panel > p,
.stat-card p,
.helper-text {
    margin: 6px 0 0;
}

.page-header h2 {
    font-size: clamp(1.7rem, 2vw, 2.2rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.page-header p {
    max-width: 68ch;
    color: var(--muted);
    font-size: 1rem;
}

.actions-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.stat-card,
.panel,
.login-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    padding: 18px 20px;
    box-shadow: var(--shadow-panel);
    backdrop-filter: blur(10px);
}

.stat-card {
    display: grid;
    gap: 8px;
    min-height: 110px;
}

.stat-card h3 {
    font-size: 0.86rem;
    color: var(--muted);
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card strong {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1;
}

.panel-grid {
    display: grid;
    gap: 14px;
}

.panel-grid.two-col {
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
}

.panel.full {
    grid-column: 1 / -1;
}

.panel h3 {
    font-size: 1.08rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.panel-title-row h3 {
    flex: 1 1 auto;
}

.panel-actions-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-sort-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
}

.dashboard-sort-control select {
    min-height: 30px;
    width: auto;
    padding: 5px 28px 5px 10px;
    border-radius: 11px;
    font-size: 0.78rem;
    font-weight: 600;
}

.panel > p {
    color: var(--muted);
}

table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

th,
td {
    text-align: left;
    padding: 11px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    font-size: 0.93rem;
    line-height: 1.4;
}

th {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

label,
fieldset {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
    font-size: var(--label-size);
    font-weight: 600;
}

legend {
    padding: 0;
    font-size: var(--label-size);
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
select,
textarea,
input[type="file"] {
    width: 100%;
    min-height: var(--control-height);
    padding: 11px 13px;
    border-radius: var(--radius-control);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.95);
    color: var(--text);
    font: inherit;
    font-weight: 500;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.45;
}

input[type="file"] {
    padding-block: 9px;
    background: rgba(255, 255, 255, 0.72);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus,
input[type="file"]:focus {
    outline: none;
    border-color: rgba(153, 54, 43, 0.42);
    box-shadow: 0 0 0 4px rgba(153, 54, 43, 0.1);
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--button-height);
    padding: 9px 15px;
    border-radius: 13px;
    border: 0;
    background: linear-gradient(180deg, #ab4336 0%, var(--accent) 100%);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0;
    box-shadow: 0 8px 18px rgba(111, 38, 31, 0.14);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

button:hover,
.button:hover {
    transform: translateY(-1px);
    filter: saturate(1.02);
}

button:focus-visible,
.button:focus-visible,
.action-link:focus-visible,
.action-group .link-button:focus-visible,
.sidebar a:focus-visible,
.menu-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(153, 54, 43, 0.15);
}

.button.secondary {
    background: linear-gradient(180deg, #2f2f2f 0%, #1f1f1f 100%);
    box-shadow: 0 8px 18px rgba(31, 31, 31, 0.14);
}

.button.button-compact,
button.button-compact {
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 11px;
    font-size: 0.78rem;
    font-weight: 600;
    box-shadow: none;
    gap: 6px;
}

.button.button-compact .action-icon,
button.button-compact .action-icon {
    width: 1rem;
    height: 1rem;
    font-size: 0.68rem;
    background: rgba(255, 255, 255, 0.08);
}

button .action-icon,
.button .action-icon {
    background: rgba(255, 255, 255, 0.12);
    color: currentColor;
    width: 1.3rem;
    height: 1.3rem;
    font-size: 0.74rem;
}

.flash {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    color: #fff;
    font-weight: 700;
    box-shadow: var(--shadow-soft);
}

.flash.success {
    background: var(--success);
}

.flash.error {
    background: var(--error);
}

.checkbox {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px 12px;
}

.checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.checkbox-list {
    max-height: 280px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    padding: 12px;
    background: rgba(255, 255, 255, 0.72);
}

.inline-form {
    display: inline;
}

.panel-title-row .inline-form {
    display: inline-flex;
    flex: 0 0 auto;
}

.link-button {
    background: transparent;
    color: var(--accent-dark);
    padding: 0;
}

.action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.action-form {
    margin: 0;
}

.action-link,
.action-group .link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--action-height);
    padding: 9px 14px;
    border-radius: var(--radius-control);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #f2efed 100%);
    color: var(--accent-dark);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: var(--shadow-soft);
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.action-link:hover,
.action-group .link-button:hover {
    background: linear-gradient(180deg, #ffffff 0%, #ece7e4 100%);
    transform: translateY(-1px);
}

.action-link.is-secondary,
.action-group .link-button.is-secondary {
    background: linear-gradient(180deg, #f8f8f8 0%, #e5e5e3 100%);
    color: #2b2b2b;
}

.action-link.is-secondary:hover,
.action-group .link-button.is-secondary:hover {
    background: linear-gradient(180deg, #f1f1f1 0%, #ddddda 100%);
}

.action-link.is-danger,
.action-group .link-button.is-danger {
    background: linear-gradient(180deg, #fff4f4 0%, #f5dddd 100%);
    color: var(--error);
    border-color: #e4b7b9;
}

.action-link.is-danger:hover,
.action-group .link-button.is-danger:hover {
    background: linear-gradient(180deg, #feeaea 0%, #efc7c8 100%);
}

.action-icon {
    display: inline-grid;
    place-items: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    background: var(--accent-soft);
    font-size: 0.8rem;
    flex: 0 0 auto;
}

.action-icon svg {
    width: 0.95rem;
    height: 0.95rem;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.table-actions {
    min-width: 280px;
}

td.table-actions .action-group {
    gap: 6px;
}

td.table-actions .action-group .action-link,
td.table-actions .action-group .link-button {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 12px;
}

td.table-actions .action-group .action-link span:last-child,
td.table-actions .action-group .link-button span:last-child {
    display: none;
}

.stack-form {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.stack-form > button,
.stack-form > .button,
.stack-form > .link-button,
.stack-form > .action-link {
    justify-self: start;
    width: auto;
}

.action-link.is-secondary .action-icon,
.action-group .link-button.is-secondary .action-icon {
    background: rgba(63, 53, 41, 0.1);
}

.action-link.is-danger .action-icon,
.action-group .link-button.is-danger .action-icon {
    background: rgba(155, 45, 48, 0.12);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
}

.tag-list li {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(153, 54, 43, 0.1);
    font-size: 0.9rem;
    font-weight: 700;
}

.truncate {
    max-width: 400px;
    word-break: break-all;
}

.thumb {
    width: 82px;
    height: 52px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #efefed;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 0.8rem;
}

.thumb-video,
.thumb-url {
    padding: 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.thumb-video svg,
.thumb-url svg {
    width: 1.15rem;
    height: 1.15rem;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.helper-text {
    margin-top: 14px;
    color: var(--muted);
    font-size: var(--helper-size);
    line-height: 1.45;
}

.helper-text.is-success {
    color: var(--success);
}

.helper-text.is-error {
    color: var(--error);
}

code {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(153, 54, 43, 0.08);
    color: var(--accent-dark);
    font-size: 0.86rem;
    font-weight: 700;
}

.notice-box {
    margin-top: 16px;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(153, 54, 43, 0.08);
    border: 1px solid var(--line);
}

.simple-list {
    margin: 10px 0 0;
    padding-left: 18px;
}

.narrow-panel {
    max-width: 520px;
}

.inset-panel {
    margin-bottom: 14px;
    background: var(--panel-strong);
}

.inset-panel h4,
.panel h4 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

details.panel summary {
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

details.panel summary::-webkit-details-marker {
    display: none;
}

details.panel summary::after {
    content: "+";
    float: right;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--accent);
}

details.panel[open] summary::after {
    content: "−";
}

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 18px;
}

.ordered-list {
    display: grid;
    gap: 10px;
}

.ordered-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(17, 17, 17, 0.06);
}

.ordered-actions {
    display: flex;
    gap: 8px;
}

.ordered-actions button {
    min-width: 40px;
    min-height: 40px;
    padding: 8px 10px;
}

.stack-form {
    margin-top: 12px;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(160px, 1fr));
    gap: 14px;
    overflow-x: auto;
}

.week-column {
    min-width: 160px;
    padding: 14px;
    border-radius: var(--radius-card);
    background: rgba(255,255,255,0.72);
    border: 1px solid var(--line);
}

.week-column h4 {
    margin: 0 0 12px;
}

.week-items {
    display: grid;
    gap: 10px;
}

.week-item {
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(17, 17, 17, 0.06);
}

.week-item strong,
.week-item span,
.week-item em {
    display: block;
}

.week-item span,
.week-item em {
    color: var(--muted);
    margin-top: 4px;
    font-size: 0.92rem;
}

.player-clients {
    display: block;
    margin-top: 14px;
}

.player-client-card {
    display: none;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
}

.player-client-card.is-active {
    display: block;
}

.player-client-card p {
    margin: 6px 0 0;
    font-size: 0.92rem;
}

.player-client-subtitle {
    color: var(--muted);
}

.player-client-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.player-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 14px;
}

.player-summary p {
    margin: 0;
}

.dashboard-stats {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.dashboard-stats .stat-card {
    min-height: 88px;
    padding: 14px 16px;
    gap: 6px;
}

.dashboard-stats .stat-card h3 {
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

.dashboard-stats .stat-card strong {
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    line-height: 1.05;
}

.dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.dashboard-panel {
    min-width: 0;
}

.dashboard-panel h3 {
    margin-bottom: 8px;
}

.dashboard-panel > p:last-child,
.dashboard-panel .helper-text:last-child {
    margin-bottom: 0;
}

.dashboard-panel--compact {
    min-height: 0;
}

.dashboard-panel--compact p,
.dashboard-panel--compact .helper-text {
    max-width: 58ch;
}

.dashboard-panel--wide,
.dashboard-grid .panel.full {
    grid-column: 1 / -1;
}

.dashboard-grid .player-panel {
    padding-top: 16px;
}

.dashboard-grid .player-summary {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px 12px;
}

.dashboard-grid .player-summary p,
.dashboard-grid .player-client-metrics p {
    font-size: 0.94rem;
}

.dashboard-grid .player-tabs {
    margin-top: 12px;
    margin-bottom: 10px;
}

.dashboard-grid .tag-list {
    gap: 8px;
    margin-bottom: 10px;
}

.dashboard-grid .tag-list li {
    padding: 7px 11px;
    font-size: 0.9rem;
}

.player-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    margin-bottom: 12px;
}

.player-tab {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-control);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.78);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.player-tab.is-active {
    border-color: rgba(153, 54, 43, 0.34);
    background: rgba(153, 54, 43, 0.08);
}

.player-tab-title {
    font-weight: 700;
}

.player-client-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 16px;
}

.player-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.player-status-pill.is-online {
    background: rgba(44, 106, 75, 0.14);
    color: var(--success);
}

.player-status-pill.is-offline {
    background: rgba(155, 45, 48, 0.12);
    color: var(--error);
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(420px, 100%);
}

@media (max-width: 900px) {
    .main {
        padding: 78px 16px 16px;
    }

    .main-toolbar {
        top: 16px;
        left: 16px;
        margin: 0;
        padding: 0;
        background: transparent;
        backdrop-filter: none;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .panel-grid.two-col {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        min-height: auto;
        padding: 14px;
    }

    .panel,
    .login-card {
        padding: 14px;
        border-radius: var(--radius-card);
    }

    .action-group {
        align-items: stretch;
    }

    .action-link,
    .action-group .link-button,
    button,
    .button {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .stack-form > button,
    .stack-form > .button,
    .stack-form > .link-button,
    .stack-form > .action-link {
        justify-self: stretch;
        width: 100%;
    }

    .table-actions {
        min-width: 220px;
    }

    .ordered-item {
        flex-direction: column;
        align-items: stretch;
    }

    .ordered-actions {
        width: 100%;
    }

    .week-grid {
        grid-template-columns: repeat(7, minmax(140px, 1fr));
        gap: 12px;
    }

}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-stats .stat-card strong {
        font-size: 1.6rem;
    }

    .sidebar {
        width: min(320px, calc(100vw - 20px));
        padding: 22px 18px;
    }

    .page-header h2 {
        font-size: 1.35rem;
    }

    th,
    td {
        font-size: 0.88rem;
    }

    .week-column,
    .week-item {
        padding: 12px;
    }
}
