/* Admin presentation follows the active mobile V2 palette and spacing scale. */
:root {
  --ink: #252827;
  --muted: #606665;
  --paper: #f7f8f6;
  --white: #fff;
  --line: #e2e6e2;
  --mint: #edf1e9;
  --accent: #252827;
  --danger: #9a3412;
  --v2-green: #d4e8ba;
  --v2-blue: #b7e3e8;
  --v2-yellow: #f6e58d;
  --v2-focus: #252827;
  --v2-radius: 24px;
  --v2-radius-small: 18px;
  --v2-shadow: 0 2px 8px #2528270a;
}
body { background: var(--paper); color: var(--ink); }
button, input, textarea, select { font-size: 14px; }
button:disabled { cursor: not-allowed; opacity: .55; }
:where(button, input, select, textarea, summary, a):focus-visible { outline: 3px solid var(--v2-focus); outline-offset: 3px; }
input:focus, textarea:focus, select:focus { border-color: var(--v2-focus); box-shadow: 0 0 0 3px #2528271a; }
.brand { color: var(--ink); }
.brand-mark, .sidebar-mark { background: var(--ink); color: #fff; border-radius: 13px; }
.brand-detail, .eyebrow, .assistant-eyebrow { color: #435a3c !important; }
.config-card, #login-card { width: min(500px, 100%); padding: clamp(24px, 4vw, 36px); }
.config-card h1, #login-card h1 { letter-spacing: -.04em; }
.card, .stat-card, .exercise-row, .workout-card, .rule-card, .professional-card, .article-card,
.assistant-metric, .assistant-feature-control, .assistant-faq-row, .assistant-request,
.import-card, .empty-state, .gamification-tabs, .assistant-filters, .planner-import-report {
  background: var(--white); border-color: var(--line); border-radius: var(--v2-radius-small); box-shadow: var(--v2-shadow);
}
.card, .stat-card { width: 100%; }
.config-card, #login-card { width: min(500px, 100%); }
.primary, .secondary { min-height: 42px; border-radius: 12px; font-weight: 700; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.primary { background: var(--ink); color: #fff; }
.primary:hover { background: #414745; }
.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.secondary:hover { background: #f1f3f0; border-color: #c8cec8; }
.secondary.danger { color: var(--danger); border-color: #efcfc3; }
.secondary.danger:hover { background: #fff7ed; }
input, select, textarea { border-color: var(--line); border-radius: 12px; color: var(--ink); background: #fff; }
input::placeholder, textarea::placeholder { color: #858b88; }
label, legend { color: var(--ink); }
.muted, .field-note, .exercise-meta, .workout-card p, .rule-card p, .professional-card-main p,
.article-card p, .assistant-section-heading p, .assistant-result-count { color: var(--muted); }
.badge { background: var(--mint); color: #344535; border-radius: 999px; }
.badge.inactive, .inactive { background: #f0f1ef; color: #5d6560; }
.message:not(:empty) { border-radius: 12px; padding: 10px 12px; background: #edf1e9; color: var(--ink); }
.message.error:not(:empty), .error:not(:empty) { background: #fff7ed; color: var(--danger); }
.rules-notice, .catalog-note { background: #edf1e9; border-color: #d7e2d2; color: var(--ink); border-radius: var(--v2-radius-small); }
.rules-notice p, .catalog-note span { color: var(--muted); }
.rules-notice .notice-icon { background: var(--ink); }
.article-crisis-notice, .assistant-safety-note { background: #fff7ed; border-color: #edc7b8; color: #71311e; }
.article-crisis-notice .notice-icon, .assistant-safety-icon { background: var(--danger); }
.stat-card { background: var(--v2-blue); min-height: 140px; }
.stat-card.mint { background: var(--v2-green); }
.stat-card p, .stat-card strong, .stat-card span { color: var(--ink); }
.stat-card p { opacity: .7; }
.admin-workspace { background: var(--paper); grid-template-columns: 250px minmax(0, 1fr); }
.admin-sidebar { background: #252827; color: #f7f8f6; padding: 24px 14px 16px; overflow: hidden; }
.sidebar-brand { border-bottom-color: #ffffff26; padding: 0 12px 21px; letter-spacing: -.05em; }
.sidebar-brand > :last-child { color: var(--v2-yellow); }
.sidebar-mark { background: var(--v2-green); color: var(--ink); }
.admin-navigation { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; gap: 2px; padding: 15px 2px 18px; }
.sidebar-group-label { margin: 16px 12px 5px; color: #aeb6af; text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 750; }
.sidebar-tab { width: 100%; min-height: 39px; padding: 9px 12px; color: #d4dbd5; font-size: 13px; font-weight: 600; line-height: 1.25; }
.sidebar-tab:hover { background: #ffffff16; color: #fff; }
.sidebar-tab.active { background: var(--v2-green); color: var(--ink); }
.sidebar-tab.active:hover { background: #e2f0d1; }
.sidebar-tab .badge { margin-left: auto; min-width: 22px; text-align: center; color: var(--ink); background: var(--v2-yellow); }
.sidebar-footer { border-top-color: #ffffff26; }
.admin-identity { background: #ffffff12; }
.admin-avatar { background: var(--v2-blue); color: var(--ink); }
.admin-identity small { color: #c7d0c8; }
.sidebar-signout { color: #f4c4b5; text-align: left; width: 100%; }
.sidebar-signout:hover { color: #fff; }
.mobile-menu-toggle { display: none; }
.admin-main { width: 100%; max-width: 1600px; padding: 38px clamp(24px, 3.5vw, 56px) 70px; }
.admin-panel { max-width: 1320px; min-width: 0; }
.panel-header h1, .dashboard-header h1, [data-panel="wellness-assistant"] .assistant-header h1 { color: var(--ink); font-size: clamp(30px, 3vw, 38px); letter-spacing: -.045em; line-height: 1.12; }
.dashboard-header { margin-bottom: 24px; }
.dashboard-header p { color: var(--muted); }
.dashboard-header .eyebrow, .dashboard-header .assistant-eyebrow { color: #435a3c; font-size: 11px; font-weight: 750; letter-spacing: .12em; }
.toolbar, .planner-toolbar, .article-toolbar, .assistant-filters, .gamification-toolbar { margin-bottom: 16px; }
.toolbar, .planner-toolbar, .article-toolbar { gap: 10px; }
.toolbar input[type="search"], .planner-toolbar input[type="search"], .article-toolbar input[type="search"] { min-width: 0; }
.selection-actions { gap: 10px; }
.row-actions { flex-wrap: wrap; justify-content: flex-end; }
.exercise-row, .professional-card, .article-card, .workout-card, .rule-card { padding: 18px 20px; }
.exercise-row h2, .professional-title h2, .article-card h2 { color: var(--ink); line-height: 1.3; }
.exercise-list, .professional-list, .article-list, .workout-list, .rule-list { gap: 10px; }
.professional-avatar, .empty-icon { background: var(--v2-blue); color: var(--ink); }
.professional-meta span, .workout-card .meta span, .rule-card .meta span { background: var(--mint); color: var(--ink); }
.professional-status.active, .assistant-status.approved, .assistant-status.answered { background: var(--v2-green); color: var(--ink); }
.professional-status.pending, .assistant-status.in_review, .assistant-status.reviewing { background: var(--v2-yellow); color: var(--ink); }
.professional-status.disabled, .assistant-status.changes_required { background: #fff0e8; color: var(--danger); }
.gamification-tabs { background: #fff; }
.gamification-tabs button.active, .engine-tabs button.active { background: var(--ink); color: #fff; }
.food-rule-table th, .food-rule-table td { border-bottom-color: var(--line); }
.food-rule-table thead { background: var(--mint); color: var(--ink); }
.food-rule-table-wrap, .weekly-shop-scroll { overflow-x: auto; }
.assistant-metric strong, .assistant-section-heading h2, .assistant-feature-control h2,
.assistant-faq-row h3, .assistant-question-title { color: var(--ink); }
.assistant-metric span, .assistant-metric small, .assistant-feature-control p, .assistant-feature-control small { color: var(--muted); }
.assistant-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.assistant-tab:hover, .assistant-text-button, .assistant-tab[aria-selected="false"]:hover { color: var(--ink); }
.assistant-tab[aria-selected="true"] span, .assistant-faq-id, .assistant-unseen-dot { background: var(--v2-green); color: var(--ink); }
.assistant-filters label { color: var(--ink); }
.assistant-filters input, .assistant-filters select { border-color: var(--line); border-radius: 10px; color: var(--ink); font-size: 13px; }
.assistant-request.unseen { border-left-color: var(--ink); }
.assistant-safety-note strong, .assistant-safety-note p { color: #71311e; }
.engine-tabs { background: var(--mint); border-color: var(--line); }
.engine-page-heading strong { background: var(--v2-green); color: var(--ink); }
.gamification-config-row, .assistant-request-detail, .article-editor-row { border-color: var(--line); }
dialog { border: 1px solid var(--line); border-radius: var(--v2-radius); box-shadow: 0 24px 70px #25282738; max-height: min(92vh, 1000px); overflow: auto; }
dialog::backdrop { background: #25282770; }
.dialog-heading { gap: 16px; }
.dialog-heading h2 { color: var(--ink); letter-spacing: -.03em; }
.dialog-actions { position: sticky; bottom: -26px; z-index: 1; padding: 15px 0 3px; background: #fff; border-top: 1px solid var(--line); }
.overview-panel { max-width: 1180px; }
.overview-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.overview-metric { min-width: 0; min-height: 160px; padding: 21px; background: var(--v2-green); border: 1px solid #cbdcba; border-radius: var(--v2-radius); }
.overview-metric:nth-child(2) { background: var(--v2-blue); border-color: #a9d8df; }
.overview-metric:nth-child(3) { background: var(--v2-yellow); border-color: #e7d779; }
.overview-metric:nth-child(4) { background: #fff; border-color: var(--line); box-shadow: var(--v2-shadow); }
.overview-metric span, .overview-metric small { display: block; color: #454b47; }
.overview-metric span { font-size: 13px; font-weight: 700; }
.overview-metric strong { display: block; margin: 17px 0 9px; color: var(--ink); font-size: clamp(22px, 2vw, 31px); line-height: 1.1; letter-spacing: -.04em; overflow-wrap: anywhere; }
.overview-metric strong[data-state="unavailable"] { font-size: 19px; }
.overview-metric small { font-size: 12px; }
.overview-sections { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .8fr); gap: 16px; }
.overview-sections .card { margin: 0; padding: 23px; }
.overview-sections h2 { margin: 0 0 17px; color: var(--ink); font-size: 20px; }
.overview-guidance p { color: var(--muted); line-height: 1.55; }
.overview-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.overview-links button { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 56px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #f7f8f6; color: var(--ink); text-align: left; font-weight: 650; }
.overview-links button:hover { background: var(--mint); border-color: #ccd9c8; }
@media (max-width: 1180px) {
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-sections { grid-template-columns: 1fr; }
  .admin-panel .dashboard-header { flex-wrap: wrap; }
  .header-actions { flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .admin-workspace { display: block; }
  .admin-sidebar { position: sticky; top: 0; z-index: 10; height: auto; padding: 10px 16px; overflow: visible; display: flex; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .sidebar-brand { border: 0; padding: 0; font-size: 20px; }
  .sidebar-brand > :last-child { font-size: 9px; }
  .mobile-menu-toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; border: 1px solid #ffffff42; border-radius: 11px; padding: 8px 12px; background: transparent; color: #fff; font-weight: 700; }
  .mobile-menu-toggle:hover { background: #ffffff16; }
  .admin-navigation { display: none; flex: 0 0 100%; max-height: calc(100dvh - 70px); overflow-y: auto; }
  .admin-navigation.open { display: flex; }
  .sidebar-nav { display: grid; flex: none; min-height: auto; overflow: visible; padding: 10px 0; gap: 2px; }
  .sidebar-tab { width: 100%; min-height: 42px; }
  .sidebar-footer { display: block; margin-top: 0; padding: 10px 0; }
  .sidebar-signout { padding: 12px 10px; }
  .admin-main { padding: 28px 18px 56px; }
  .admin-panel .dashboard-header .header-actions button { width: auto; }
  .overview-metrics { gap: 10px; }
}
@media (max-width: 560px) {
  .overview-metrics, .overview-links { grid-template-columns: 1fr; }
  .overview-metric { min-height: 130px; }
  .overview-metric strong { margin: 10px 0 6px; }
  .overview-sections .card { padding: 18px; }
  .admin-panel .dashboard-header .header-actions { width: 100%; }
  .admin-panel .dashboard-header .header-actions > :is(button, label, select) { flex: 1 1 100%; }
  .row-actions { justify-content: flex-start; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions button { flex: 1; }
  .gamification-release-actions { width: 100%; }
  .gamification-release-actions button { flex: 1 1 calc(50% - 8px) !important; width: auto !important; }
  .assistant-reply-row { flex-wrap: wrap; }
}

/* Featured workout catalogue: compact, filterable and designed for scanning. */
[data-panel="workouts"] { max-width: 1320px; }
.workout-page-header { align-items: flex-start; }
.workout-page-header > div:first-child { max-width: 720px; }
.workout-page-header .header-actions { flex-wrap: wrap; justify-content: flex-end; }
.workout-catalogue-controls { margin: 18px 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--v2-shadow); }
.workout-filter-row { display: grid; grid-template-columns: minmax(280px, 1.7fr) repeat(3, minmax(150px, .8fr)); gap: 9px; }
.workout-filter-row :is(input, select) { min-width: 0; min-height: 44px; }
.workout-results-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.workout-results-row .collection-heading { align-items: center; }
.workout-results-row h2 { font-size: 17px; letter-spacing: -.02em; }
.workout-results-row #workout-count { font-size: 13px; }
.workout-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
.workout-card { min-width: 0; padding: 18px; border-color: var(--line); border-radius: 18px; box-shadow: var(--v2-shadow); }
.workout-card:hover { border-color: #cbd2cc; box-shadow: 0 8px 24px #2528270d; }
.workout-card-head { align-items: flex-start; gap: 12px; }
.workout-select-title { min-width: 0; flex: 1; gap: 10px; }
.workout-select-title .row-select { flex: none; margin-top: 4px; }
.workout-title-block { min-width: 0; }
.workout-card .source { display: flex; align-items: center; gap: 7px; margin: 0 0 5px; color: #707672; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: none; }
.workout-card .source span + span::before { content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 7px 2px 0; border-radius: 50%; background: #9ba19d; }
.workout-card h3 { margin: 0; color: var(--ink); font-size: 19px; line-height: 1.25; letter-spacing: -.025em; }
.workout-card-head .row-actions { align-items: center; gap: 5px; }
.workout-card-head .row-actions .edit-workout { min-height: 36px; padding: 7px 11px; border-radius: 10px; }
.workout-delete { min-height: 36px; padding: 7px 8px; border: 0; border-radius: 9px; background: transparent; color: #777d79; font-size: 13px; font-weight: 650; }
.workout-delete:hover { background: #fff3ed; color: var(--danger); }
.workout-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.workout-facts span { padding: 5px 8px; border-radius: 999px; background: #f0f2ef; color: #4c524e; font-size: 12px; font-weight: 650; line-height: 1; }
.workout-facts .workout-status { text-transform: capitalize; }
.workout-facts .workout-status.draft { background: #fff0d8; color: #754715; }
.workout-facts .workout-status.published { background: var(--v2-green); color: #293b25; }
.workout-facts .workout-status.archived { background: #e9e9e7; color: #5d625f; }
.workout-summary { display: grid; grid-template-columns: minmax(145px, .75fr) minmax(0, 1.25fr); gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.workout-summary > div { min-width: 0; }
.workout-field-label { display: block; margin-bottom: 4px; color: #777d79; font-size: 12px; font-weight: 700; }
.workout-summary strong, .workout-summary p { color: #353a37; font-size: 14px; line-height: 1.45; }
.workout-summary strong { display: block; font-weight: 650; }
.workout-card .workout-equipment { display: -webkit-box; margin: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.workout-card .workout-description { margin: 0 0 12px; font-size: 13px; line-height: 1.45; }
.workout-card .workout-plan { padding: 0; border-top: 1px solid var(--line); }
.workout-plan > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 0; color: var(--ink); font-size: 14px; font-weight: 700; list-style: none; }
.workout-plan > summary::-webkit-details-marker { display: none; }
.workout-plan > summary::after { content: "+"; display: grid; place-items: center; width: 24px; height: 24px; margin-left: auto; border-radius: 7px; background: #f0f2ef; color: #555b57; font-size: 17px; line-height: 1; }
.workout-plan[open] > summary::after { content: "−"; }
.workout-plan > summary span:last-of-type { color: #777d79; font-size: 12px; font-weight: 650; }
.workout-exercise-list { display: grid; gap: 0; margin-top: 11px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.workout-exercise-item { display: grid; grid-template-columns: 25px minmax(130px, 1fr) auto auto; align-items: center; gap: 8px; min-width: 0; padding: 9px 10px; background: #fafbf9; border-bottom: 1px solid var(--line); }
.workout-exercise-item:last-child { border-bottom: 0; }
.workout-exercise-number { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--mint); color: #465443; font-size: 11px; font-weight: 800; }
.workout-exercise-item strong { min-width: 0; overflow: hidden; color: #363b38; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.workout-exercise-item > span:not(.workout-exercise-number) { color: #707672; font-size: 12px; white-space: nowrap; }
.workout-empty { grid-column: 1 / -1; padding: 46px 24px; border: 1px dashed #cbd2cc; border-radius: 18px; background: #fff; text-align: center; }
.workout-empty strong { display: block; font-size: 17px; }
.workout-empty p { margin: 6px 0 0; color: var(--muted); }
@media (max-width: 1120px) {
  .workout-filter-row { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .workout-filter-row input { grid-column: 1 / -1; }
  .workout-list { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .workout-page-header .header-actions { justify-content: stretch; }
  .workout-page-header .header-actions > * { flex: 1 1 100%; justify-content: center; }
  .workout-filter-row { grid-template-columns: 1fr; }
  .workout-filter-row input { grid-column: auto; }
  .workout-results-row { align-items: flex-start; flex-direction: column; }
  .workout-results-row .selection-actions { margin-left: 0; flex-wrap: wrap; }
  .workout-card-head { flex-direction: column; }
  .workout-card-head .row-actions { width: 100%; justify-content: flex-end; }
  .workout-summary { grid-template-columns: 1fr; gap: 10px; }
  .workout-exercise-item { grid-template-columns: 25px minmax(0, 1fr) auto; }
  .workout-exercise-item > span:last-child { grid-column: 2 / -1; }
}
@media (max-width: 430px) {
  .workout-results-row .selection-actions { align-items: stretch; flex-direction: column; width: 100%; }
  .workout-results-row .selection-actions button { width: 100%; }
  .workout-card { padding: 15px; }
  .workout-card h3 { font-size: 18px; }
  .workout-exercise-item { grid-template-columns: 24px minmax(0, 1fr); }
  .workout-exercise-item > span:not(.workout-exercise-number) { grid-column: 2; }
}
