/*
 * treatment.css -- shared styling deltas for the eight zone editor pages.
 *
 * Most of the visual surface for the treatment editors reuses the legacy
 * `.ml-*` classes already shipped in panel.css (toolbar, tile grid, bucket
 * tile mosaic, detail drawer, bulk bar) and the NEW ADMIN `.ui-*` classes
 * already shipped in ui-components.css / ui-shell.css (cards, forms, table,
 * pills, buttons, notices). This file adds only the deltas the framework
 * needs that those two systems do not already cover, namely:
 *
 *   - .tx-card          : a treatment-page card wrapper
 *   - .tx-subtabs       : horizontal sub-tab strip per treatment detail
 *   - .tx-section-status: the read-only "section is enabled on site" pill row
 *   - .tx-about         : the per-page / per-sub-tab help panel
 *   - .tx-schedule-row  : compact row used for milestone / release / rotation entries
 *   - .tx-empty         : tiny empty-state used by zone-specific cards
 *
 * Stays in the ui-* token system: never invents colors; reads
 * --c-text / --c-bg / --c-border / --c-primary / --c-text-muted /
 * --c-surface from tokens.css, and reuses the existing radii / spacing.
 */

/* Top-level page chrome --------------------------------------------------- */
body[data-page="theater"] .admin-main,
body[data-page="livetv"]  .admin-main,
body[data-page="french"]  .admin-main,
body[data-page="edvd"]    .admin-main,
body[data-page="drop"]    .admin-main,
body[data-page="events"]  .admin-main,
body[data-page="inspire"] .admin-main,
body[data-page="humor"]   .admin-main,
body[data-page="personalities"] .admin-main {
    /* Treatment pages are wider than the default Settings tier. */
    max-width: none;
    padding: var(--sp-5) var(--sp-6) 80px;
}

.tx-page {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
    width: 100%;
}

.tx-page__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-4);
    flex-wrap: wrap;
}

.tx-page__title {
    margin: 0;
    font-size: var(--fs-xl, 22px);
    font-weight: 650;
    color: var(--c-text);
    line-height: 1.25;
}

.tx-page__subtitle {
    margin: 4px 0 0;
    color: var(--c-text-muted);
    font-size: var(--fs-sm);
}

.tx-page__actions {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
}

/* Cards ------------------------------------------------------------------- */
.tx-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.tx-card--flush { padding: 0; }
.tx-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    flex-wrap: wrap;
}
.tx-card__title {
    margin: 0;
    font-size: var(--fs-md, 16px);
    font-weight: 650;
    color: var(--c-text);
}
.tx-card__subtitle {
    margin: 2px 0 0;
    color: var(--c-text-muted);
    font-size: var(--fs-xs);
}
.tx-card__actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.tx-card__body { display: flex; flex-direction: column; gap: var(--sp-3); }
.tx-help {
    color: var(--c-text-muted);
    font-size: var(--fs-xs);
}
.tx-help summary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    cursor: pointer;
    color: var(--c-text-muted);
    font-weight: 600;
    list-style: none;
}
.tx-help summary::-webkit-details-marker { display: none; }
.tx-help summary::after {
    content: "⌄";
    font-size: 0.85em;
    transition: transform 0.15s ease;
}
.tx-help[open] summary::after { transform: rotate(180deg); }
.tx-help p,
.tx-help ul {
    margin: 8px 0 0;
    line-height: 1.55;
}
.tx-help code {
    font-family: var(--ff-mono);
    font-size: 0.875em;
    background: var(--c-hover);
    padding: 1px 5px;
    border-radius: var(--radius-sm);
}

/* Sub-tabs ---------------------------------------------------------------- */
.tx-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: var(--sp-3);
}
.tx-subtab {
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    color: var(--c-text-muted);
    text-decoration: none;
    font-size: var(--fs-sm);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color var(--ease), border-color var(--ease);
}
.tx-subtab:hover { color: var(--c-text); }
.tx-subtab.is-active {
    color: var(--c-primary);
    border-bottom-color: var(--c-primary);
}

/* Section status row ------------------------------------------------------ */
.tx-section-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 999px;
    font-size: var(--fs-xs);
    color: var(--c-text-muted);
}
.tx-section-status strong {
    color: var(--c-text);
    font-weight: 650;
    letter-spacing: 0.04em;
}
.tx-section-status a {
    color: var(--c-primary);
    text-decoration: none;
}
.tx-section-status a:hover { text-decoration: underline; }

/* About-this-section panel ------------------------------------------------ */
.tx-about {
    border: 1px solid var(--c-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--c-surface) 96%, var(--c-primary) 4%);
    overflow: hidden;
}
.tx-about__summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--c-text);
    font-weight: 600;
    font-size: var(--fs-sm);
    transition: background var(--ease);
}
.tx-about__summary::-webkit-details-marker { display: none; }
.tx-about__summary:hover {
    background: color-mix(in srgb, var(--c-primary) 6%, transparent);
}
.tx-about__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.tx-about__title { flex-shrink: 0; }
.tx-about__hint {
    color: var(--c-text-muted);
    font-weight: 400;
    font-size: var(--fs-xs);
    margin-left: 6px;
    flex: 1 1 200px;
    min-width: 0;
}
.tx-about:not([open]) .tx-about__hint {
    display: none;
}
.tx-about[open] .tx-about__summary {
    border-bottom: 1px solid var(--c-border);
    background: color-mix(in srgb, var(--c-primary) 4%, transparent);
}
.tx-about__body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.tx-about__section h4 {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.tx-about__section p,
.tx-about__section li {
    margin: 0 0 6px;
    color: var(--c-text);
    font-size: var(--fs-sm);
    line-height: 1.55;
}
.tx-about__section ul {
    margin: 0;
    padding-left: 20px;
}
.tx-about__dl {
    display: grid;
    grid-template-columns: minmax(140px, max-content) 1fr;
    gap: 6px 14px;
    margin: 0;
}
.tx-about__dl dt {
    font-weight: 600;
    color: var(--c-text);
    font-size: var(--fs-sm);
}
.tx-about__dl dd {
    margin: 0;
    color: var(--c-text-muted);
    font-size: var(--fs-sm);
    line-height: 1.5;
}
.tx-about__deep .tx-about__deep-item {
    border: 1px dashed var(--c-border);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 6px;
}
.tx-about__deep .tx-about__deep-item summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--c-text);
    font-size: var(--fs-sm);
}
.tx-about__deep .tx-about__deep-item[open] summary { margin-bottom: 6px; }

/* Schedule rows (milestone, release, rotation) ---------------------------- */
.tx-schedule-row {
    display: grid;
    grid-template-columns: minmax(140px, 200px) 1fr minmax(120px, 180px) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    background: var(--c-bg);
}
.tx-schedule-row + .tx-schedule-row { margin-top: 6px; }
.tx-schedule-row .tx-schedule-key {
    font-weight: 600;
    color: var(--c-text);
    font-size: var(--fs-sm);
}
.tx-schedule-row .tx-schedule-meta {
    color: var(--c-text-muted);
    font-size: var(--fs-xs);
}

/* Tiny empty-state ------------------------------------------------------- */
.tx-empty {
    text-align: center;
    color: var(--c-text-muted);
    font-size: var(--fs-sm);
    padding: 28px 14px;
    border: 1px dashed var(--c-border);
    border-radius: 10px;
    background: var(--c-bg);
}

/* Personality picker tile ------------------------------------------------- */
.tx-personality {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    background: var(--c-bg);
    color: var(--c-text);
    font-size: var(--fs-sm);
    text-decoration: none;
}
.tx-personality__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--c-surface-alt, #e2e8f0);
    object-fit: cover;
    flex-shrink: 0;
}
.tx-personality__avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.tx-personality__kind {
    color: var(--c-text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Drag-drop drop target ------------------------------------------------- */
.is-drop-target {
    outline: 2px dashed var(--c-primary);
    outline-offset: -3px;
}
