/**
 * Run Creator styles on top of the Eyes On theme (eyes-theme.css + common.css from the Client
 * Module). Rules ported from Docs/schedulepack_prototype.html: layout chrome, view levels
 * (decision 20), board rows, builder grid, cards with the three approval states.
 */

/* ---- Chrome (from the Client Module layout) ---- */
.portal-chrome { padding-top: 4.5rem; }
.client-manage-bar { position: sticky; top: 4.5rem; z-index: 1020; background: #f8f9fa; border-bottom: 1px solid rgba(0, 0, 0, .08); margin-bottom: 1rem; }
.portal-chrome > main.container-xxl { padding-top: 1rem; }
.navbar-portal .navbar-brand-wrap { text-decoration: none; text-align: left; max-width: min(100%, 360px); }
.global-notice-wrap { position: fixed; left: 50%; transform: translateX(-50%); width: min(92vw, 780px); z-index: 1060; pointer-events: none; text-align: center; }
.global-notice { text-align: center; margin: 0; box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15); }
.data-notice { border-left: 4px solid #c9a200; }

/* ---- View levels (decision 20): hide settings above the chosen level unless in use ---- */
body.lvl-basic [data-level="advanced"]:not(.lvl-inuse),
body.lvl-basic [data-level="expert"]:not(.lvl-inuse),
body.lvl-advanced [data-level="expert"]:not(.lvl-inuse) { display: none !important; }
.lvl-badge { display: none; font-size: .6rem; font-weight: 700; line-height: 1.2; padding: .1rem .35rem; border-radius: .25rem; margin-left: .35rem; vertical-align: middle; white-space: nowrap; cursor: help; background: #fff3cd; color: #664d03; border: 1px solid #ffe69c; }
.lvl-badge[data-badge-level="expert"], .lvl-tag.expert { background: #f3e8fd; color: #5a2a82; border-color: #dcc4f2; }
body.lvl-basic .lvl-badge, body.lvl-advanced .lvl-badge[data-badge-level="expert"] { display: inline-block; }
.lvl-tag { display: inline-block; font-size: .65rem; font-weight: 700; line-height: 1.2; padding: .05rem .35rem; border-radius: .25rem; background: #fff3cd; color: #664d03; border: 1px solid #ffe69c; vertical-align: middle; }
.lvl-switch { display: inline-flex; }
.lvl-switch .btn { border-radius: 0; font-weight: 600; padding: .15rem .55rem; font-size: .8rem; }
.lvl-switch > span + span .btn { margin-left: -1px; }
.lvl-switch > span:first-child .btn { border-radius: .3rem 0 0 .3rem; }
.lvl-switch > span:last-child .btn { border-radius: 0 .3rem .3rem 0; }
.lvl-switch .btn:disabled { opacity: .45; }
.lvl-more { font-size: .78rem; white-space: nowrap; }

/* ---- Board ---- */
.due-late { background: #fde2e1 !important; }
.due-soon { background: #fff4d6 !important; }
.kpi { background: #fff; border: 1px solid #dee2e6; border-radius: .6rem; padding: .7rem .9rem; }
.kpi .n { font-family: 'Bitter', serif; font-size: 1.6rem; font-weight: 700; line-height: 1; }
.kpi .l { font-size: .75rem; color: var(--portal-text-muted); }
.board-part td { font-size: .85rem; background: #fcfcfd; }
.board-part td:first-child { padding-left: 2rem; }
.row-pending td { color: var(--portal-text-muted); }

/* ---- Builder grid ---- */
.builder { display: grid; grid-template-columns: 56px 300px 1fr 260px; gap: 1rem; align-items: start; }
.builder.lib-compact { grid-template-columns: 56px 190px 1fr 260px; }
@media (max-width: 1200px) { .builder { grid-template-columns: 56px 260px 1fr; } .builder.lib-compact { grid-template-columns: 56px 190px 1fr; } .slot-panel { display: none; } }
.pullout-tabs { display: flex; flex-direction: column; gap: .35rem; position: sticky; top: 7.5rem; }
.pullout-tabs button { width: 56px; height: 56px; border: 1px solid #dee2e6; background: #fff; border-radius: .6rem; color: var(--portal-text-muted); font-size: 1.15rem; position: relative; }
.pullout-tabs button.active { background: var(--portal-primary); color: #fff; border-color: var(--portal-primary); }
.pullout-tabs button .lbl { display: block; font-size: .6rem; line-height: 1; margin-top: .15rem; }
.library { background: #fff; border: 1px solid #dee2e6; border-radius: .6rem; padding: .75rem; position: sticky; top: 7.5rem; max-height: calc(100vh - 8.5rem); overflow: auto; }
.library h6 { font-family: 'Bitter', serif; margin-bottom: .25rem; }
.lib-card { display: flex; gap: .5rem; align-items: flex-start; border: 1px solid #e9ecef; border-radius: .5rem; padding: .5rem .6rem; margin-bottom: .45rem; background: #fff; }
.lib-card .t { font-weight: 600; font-size: .85rem; }
.lib-card .d { font-size: .75rem; color: var(--portal-text-muted); }
.lib-card .btn { margin-left: auto; }
.library.compact { padding: .5rem; }
.library.compact .lib-card { padding: .3rem .45rem; margin-bottom: .3rem; align-items: center; }
.library.compact .lib-card .t { font-size: .8rem; line-height: 1.2; }
.library.compact .lib-card .d { display: none; }
.library.compact .lib-card .btn { padding: 0 .35rem; font-size: .75rem; line-height: 1.5; }
.packbox { min-height: 50vh; background: #fff; border: 2px dashed #cfd8dc; border-radius: .75rem; padding: 1rem; }
.packbox .empty { color: var(--portal-text-muted); text-align: center; padding: 4rem 1rem; }
.slot-panel { position: sticky; top: 7.5rem; }
.slot { display: flex; align-items: center; gap: .4rem; font-size: .8rem; padding: .1rem 0; }
.slot .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.dot.st-approved { background: #3f6b00; } .dot.st-valid { background: #c9a200; } .dot.st-invalid { background: #b42318; } .dot.st-none { background: #ced4da; }

/* ---- Cards: three approval states (decision 15) ---- */
.pcard { border: 1px solid #dee2e6; border-left: 4px solid #c9a200; border-radius: .5rem; margin-bottom: .5rem; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); font-size: .9rem; }
.pcard .pcard-h { display: flex; align-items: center; gap: .5rem; padding: .3rem .6rem; border-bottom: 1px solid #eef0f2; background: #fff8e1; border-radius: .4rem .4rem 0 0; min-height: 36px; cursor: pointer; }
.pcard .pcard-h .ic { width: 24px; height: 24px; flex: 0 0 24px; border-radius: .35rem; background: rgba(0, 118, 130, .1); color: var(--portal-primary); display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.pcard .pcard-h .title { font-weight: 700; white-space: nowrap; }
.pcard .pcard-h .badge { font-size: .6rem; }
.pcard .pcard-h .summary { font-size: .78rem; color: var(--portal-text-muted); margin-left: auto; text-align: right; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .pcard-h .btn-link { padding: 0 .25rem; line-height: 1; }
.pcard .pcard-b { padding: .6rem; }
.pcard.collapsed .pcard-h { border-bottom: 0; border-radius: .4rem; }
.pcard.collapsed .pcard-b { display: none; }
.pcard.st-valid { border-left-color: #c9a200; }
.pcard.st-approved { border-left-color: #3f6b00; background: #f6faf3; }
.pcard.st-approved .pcard-h { background: #eaf5e6; }
.pcard.st-approved .pcard-h .ic { background: rgba(63, 107, 0, .12); color: #3f6b00; }
.pcard.st-invalid { border-color: #f1aeb5; border-left-color: #b42318; }
.pcard.st-invalid .pcard-h { background: #fdecea; }
.pcard.st-invalid .pcard-h .ic { background: rgba(180, 35, 24, .1); color: #b42318; }
.tick-btn { border: 0; background: none; padding: 0 .2rem; line-height: 1; font-size: 1.05rem; color: #adb5bd; }
.tick-btn:hover:not(:disabled) { color: #3f6b00; }
.tick-btn.on { color: #3f6b00; }
.tick-btn:disabled { opacity: .4; cursor: not-allowed; }
.sf-badge { font-size: .55rem; font-weight: 700; background: #e7f4f5; color: var(--portal-primary); border: 1px solid #b6dde1; border-radius: .25rem; padding: 0 .25rem; vertical-align: middle; }

/* ---- Program block and run header ---- */
.prog-block, .run-head { background: #fff; border: 1px solid #dee2e6; border-left: 4px solid #c9a200; border-radius: .6rem; margin-bottom: .75rem; }
.prog-block.st-approved, .run-head.st-approved { border-left-color: #3f6b00; background: #eaf5e6; }
.prog-block.st-invalid, .run-head.st-invalid { border-color: #f1aeb5; border-left-color: #b42318; background: #fdecea; }
.prog-block .pb-h { display: flex; align-items: center; gap: .6rem; padding: .5rem .8rem; flex-wrap: wrap; }
.prog-block .pb-b { padding: .6rem .8rem; border-top: 1px solid #eef0f2; }
.run-head { padding: .55rem .8rem; font-size: .85rem; }
.run-head .rh-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.run-head .rh-k { font-weight: 700; white-space: nowrap; }
.parts-bar { margin-bottom: .5rem; }
.parts-bar .nav-link { font-size: .85rem; padding: .3rem .7rem; }
.parts-bar .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }

/* ---- Manage client list/detail screens ---- */
.mc-list .list-group-item { font-size: .85rem; cursor: pointer; }
.mc-list .list-group-item.active { background: var(--portal-primary); border-color: var(--portal-primary); }
