/* ============================================================
   DCC-i Session Tools v3 — Stylesheet
   ============================================================ */

:root {
    --p:       #3E1E67;   /* primary purple */
    --p-mid:   #6b3fa0;
    --p-soft:  #f0eaf7;
    --p-dark:  #2a1247;
    --green:   #1a7f4b;
    --g-soft:  #e6f7ee;
    --amber:   #b45309;
    --a-soft:  #fff8ed;
    --red:     #dc2626;
    --r-soft:  #fef2f2;
    --grey:    #6b7280;
    --gr-soft: #f3f4f6;
    --border:  #e5e7eb;
    --white:   #ffffff;
    --text:    #1f2937;
    --rad:     12px;
    --shad:    0 2px 16px rgba(0,0,0,.08);
    --shad-lg: 0 8px 32px rgba(0,0,0,.12);
}

/* ── Shared components ─────────────────────────────────────── */

.td-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 22px; background: var(--p); color: #fff !important;
    border: 2px solid var(--p); border-radius: 8px;
    font-size: .93rem; font-weight: 600; cursor: pointer;
    text-decoration: none; transition: opacity .15s, transform .1s;
    white-space: nowrap; line-height: 1;
}
.td-btn:hover { opacity: .88; transform: translateY(-1px); }
.td-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.td-btn--sm  { padding: 7px 14px; font-size: .8rem; }
.td-btn--lg  { padding: 13px 28px; font-size: 1rem; }
.td-btn--open  { background: var(--green); border-color: var(--green); }
.td-btn--close { background: var(--white); color: var(--grey) !important;
                 border-color: var(--border); }
.td-btn--close:hover { background: var(--gr-soft); }
.td-btn--enter { background: var(--p); margin-top: auto; width: 100%;
                 justify-content: center; }
.td-btn--reset {
    background: #fff5f5;
    color: #b91c1c !important;
    border-color: #fca5a5;
    font-size: .85rem;
}
.td-btn--reset:hover { background: #fee2e2; }
.td-btn--copy-msg { background: var(--p-soft); color: var(--p) !important;
                    border-color: var(--p-soft); font-size: .9rem; }
.td-btn--copy-msg:hover { background: var(--p); color: #fff !important; }

.td-badge {
    display: inline-block; padding: 4px 12px; border-radius: 20px;
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
}
.td-badge--live       { background: var(--g-soft); color: var(--green); }
.td-badge--not-opened { background: var(--a-soft);  color: var(--amber); }
.td-badge--closed     { background: var(--gr-soft); color: var(--grey); }
.td-badge--lg { font-size: .8rem; padding: 5px 16px; }

.td-label {
    display: block; font-size: .75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--grey); margin-bottom: 8px;
}
.td-input {
    flex: 1; padding: 10px 14px; border: 1.5px solid var(--border);
    border-radius: 8px; font-size: .9rem; min-width: 0;
    transition: border-color .15s;
}
.td-input:focus { border-color: var(--p); outline: none;
                  box-shadow: 0 0 0 3px rgba(62,30,103,.1); }
.td-input--readonly { background: var(--gr-soft); color: var(--grey); }
.td-hint { font-size: .78rem; color: var(--grey); margin: 6px 0 0; }
.td-pw-set { font-size: .75rem; color: var(--green); font-weight: 600;
             margin-left: 6px; }
.td-hidden { display: none !important; }
.td-error { background: var(--r-soft); color: var(--red); padding: 16px;
            border-radius: var(--rad); font-size: .9rem; }

/* ── HOME VIEW ─────────────────────────────────────────────── */

.td-home { max-width: 1000px; margin: 0 auto; padding: 32px 20px 60px; }

.td-home__header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 40px; gap: 16px;
}
.td-home__greeting { font-size: .9rem; color: var(--grey); margin: 0 0 2px; text-transform: capitalize; }
.td-home__name { font-size: 1.8rem; color: var(--p); margin: 0; }
.td-home__date { font-size: .9rem; color: var(--grey); text-align: right;
                 padding-top: 6px; white-space: nowrap; }

.td-section { margin-bottom: 40px; }
.td-section--past { opacity: .8; }
.td-section__heading {
    font-size: 1rem; font-weight: 700; color: var(--grey);
    text-transform: uppercase; letter-spacing: .06em;
    margin: 0 0 16px; padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}
.td-section__heading--today {
    color: var(--p); border-bottom-color: var(--p);
}
.td-section__heading--past { font-size: .85rem; }

.td-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.td-cards--today { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }

.td-card {
    background: var(--white); border: 1.5px solid var(--border);
    border-radius: var(--rad); padding: 20px;
    display: flex; flex-direction: column; gap: 8px;
    transition: box-shadow .2s, transform .15s;
    position: relative; overflow: hidden;
}
.td-card:hover { box-shadow: var(--shad); transform: translateY(-2px); }
.td-card--large { padding: 24px; }
.td-card--live   { border-color: #86efac; }
.td-card--closed { opacity: .7; }

.td-card__top { display: flex; justify-content: space-between; align-items: center; }
.td-card__indicators { display: flex; gap: 8px; }
.td-indicator {
    font-size: .72rem; font-weight: 600; padding: 2px 8px;
    border-radius: 10px;
}
.td-indicator--yes { background: var(--g-soft); color: var(--green); }
.td-indicator--no  { background: var(--a-soft); color: var(--amber); }

.td-card__title { font-size: 1.05rem; color: var(--text); margin: 4px 0 2px; font-weight: 700; }
.td-card--large .td-card__title { font-size: 1.25rem; }
.td-card__org  { font-size: .85rem; color: var(--grey); margin: 0; }
.td-card__meta { font-size: .82rem; color: var(--grey); margin: 0; }

.td-empty { padding: 24px; background: var(--gr-soft); border-radius: var(--rad);
            color: var(--grey); text-align: center; }
.td-empty--full { padding: 60px 32px; text-align: center; }
.td-empty__icon { font-size: 3rem; margin-bottom: 12px; }
.td-empty--full h3 { color: var(--p); margin: 0 0 8px; }
.td-empty--full p  { color: var(--grey); margin: 0; }

/* ── CONTROL ROOM ──────────────────────────────────────────── */

.td-cr { max-width: 860px; margin: 0 auto; padding: 24px 20px 60px; }

.td-back {
    display: inline-block; color: var(--p); font-size: .85rem;
    text-decoration: none; margin-bottom: 20px; opacity: .8;
}
.td-back:hover { opacity: 1; }

.td-cr__header {
    background: var(--p); border-radius: var(--rad);
    padding: 28px 32px; margin-bottom: 24px; color: #fff;
}
.td-cr__title { font-size: 1.6rem; color: #fff; margin: 10px 0 6px; }
.td-cr__meta  { font-size: .88rem; color: rgba(255,255,255,.75); margin: 0; }

.td-cr__panel {
    background: var(--white); border: 1.5px solid var(--border);
    border-radius: var(--rad); padding: 24px 28px; margin-bottom: 20px;
}
.td-cr__panel-title {
    font-size: 1rem; font-weight: 700; color: var(--text);
    margin: 0 0 20px;
}
.td-panel-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.td-panel-header .td-cr__panel-title { margin: 0; }

.td-ctrl-group { margin-bottom: 20px; }
.td-ctrl-group:last-child { margin-bottom: 0; }

.td-input-row { display: flex; gap: 8px; }
.td-action-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Share box ─────────────────────────────────────────────── */

.td-cr__share { margin-bottom: 20px; }
.td-share {
    background: linear-gradient(135deg, var(--p) 0%, var(--p-mid) 100%);
    border-radius: var(--rad); padding: 24px 28px;
    display: flex; align-items: flex-start; gap: 16px; color: #fff;
}
.td-share__icon { font-size: 2rem; flex-shrink: 0; margin-top: 2px; }
.td-share__title { font-size: 1rem; font-weight: 700; margin: 0 0 10px; color: #fff; }
.td-share__details {
    display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px;
    background: rgba(255,255,255,.12); border-radius: 8px;
    padding: 12px 16px;
}
.td-share__field { font-size: .9rem; color: rgba(255,255,255,.9); }
.td-share__field strong { color: #fff; }

/* ── Tables ────────────────────────────────────────────────── */

.td-pill {
    background: var(--p-soft); color: var(--p);
    border-radius: 20px; padding: 3px 10px;
    font-size: .75rem; font-weight: 600;
}
.td-spinner {
    margin-left: auto; font-size: 1rem; color: var(--grey);
    opacity: .45; transition: opacity .3s; display: inline-block;
}
.td-spin { opacity: 1; animation: td-rotate 1s linear infinite; }
@keyframes td-rotate { to { transform: rotate(360deg); } }

.td-table-wrap { overflow-x: auto; }
.td-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.td-table th {
    padding: 9px 14px; text-align: left;
    font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--p-mid); border-bottom: 2px solid var(--p-soft);
    white-space: nowrap;
}
.td-table td {
    padding: 11px 14px; border-bottom: 1px solid var(--border);
    color: var(--text); vertical-align: middle;
}
.td-table tr:last-child td { border-bottom: 0; }
.td-empty-cell {
    text-align: center; color: var(--grey);
    font-style: italic; padding: 24px !important;
}

.td-cell {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 6px;
    font-size: .82rem; font-weight: 600;
}
.td-cell--none { background: var(--gr-soft); color: var(--grey); }
.td-cell--done { background: var(--g-soft); color: var(--green); }

.td-legend {
    display: flex; gap: 16px; padding: 12px 14px 0;
    font-size: .78rem; color: var(--grey); align-items: center;
}
.td-leg::before {
    content: ''; display: inline-block;
    width: 14px; height: 14px; border-radius: 3px; margin-right: 5px;
    vertical-align: middle;
}
.td-leg--none::before { background: var(--gr-soft); }
.td-leg--done::before { background: var(--g-soft); }

/* ── Toast ─────────────────────────────────────────────────── */

.td-toast {
    position: fixed; bottom: 28px; right: 28px;
    background: var(--p); color: #fff;
    padding: 13px 22px; border-radius: 10px;
    font-size: .9rem; font-weight: 500;
    box-shadow: var(--shad-lg); z-index: 99999;
    opacity: 0; transform: translateY(10px);
    transition: opacity .25s, transform .25s;
    pointer-events: none; max-width: 340px;
}
.td-toast--show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.td-toast--err  { background: var(--red); }

/* ── Delegate join form ─────────────────────────────────────── */

.dcci-join {
    min-height: 80vh; display: flex; align-items: center;
    justify-content: center; padding: 40px 20px;
    background: var(--gr-soft);
}
.dcci-join__card {
    background: var(--white); border-radius: var(--rad);
    box-shadow: var(--shad-lg); padding: 40px;
    width: 100%; max-width: 520px;
}
.dcci-join__brand { margin-bottom: 24px; }
.dcci-join__brand-logo {
    background: var(--p); color: #fff; padding: 4px 10px;
    border-radius: 6px; font-size: .75rem; font-weight: 800;
    letter-spacing: .08em;
}
.dcci-join__session-title { font-size: 1.5rem; color: var(--p); margin: 0 0 6px; }
.dcci-join__session-meta  { font-size: .85rem; color: var(--grey); margin: 0 0 20px; }
.dcci-join__intro  { font-size: .9rem; color: var(--grey); margin-bottom: 20px; }
.dcci-join__error  {
    background: var(--r-soft); color: var(--red); border: 1px solid #fca5a5;
    border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; font-size: .9rem;
}
.dcci-join__closed { text-align: center; padding: 24px; color: var(--grey); }
.dcci-join__row    { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dcci-join__field  { margin-bottom: 16px; }
.dcci-join__field label {
    display: block; font-size: .82rem; font-weight: 600;
    color: var(--text); margin-bottom: 6px;
}
.dcci-join__field input {
    width: 100%; padding: 10px 12px; border: 1.5px solid var(--border);
    border-radius: 8px; font-size: .93rem; box-sizing: border-box;
    transition: border-color .15s;
}
.dcci-join__field input:focus { border-color: var(--p); outline: none;
    box-shadow: 0 0 0 3px rgba(62,30,103,.1); }
.dcci-join__hint { display: block; font-size: .78rem; color: var(--grey); margin-top: 5px; }
.dcci-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 22px; background: var(--p); color: #fff !important;
    border: 2px solid var(--p); border-radius: 8px;
    font-size: .93rem; font-weight: 600; cursor: pointer;
    text-decoration: none; transition: opacity .15s;
}
.dcci-btn:hover { opacity: .88; }
.dcci-btn--full { width: 100%; justify-content: center; padding: 13px; }
.dcci-btn--ghost { background: transparent; color: var(--grey) !important;
                   border-color: var(--border); cursor: default; }


/* ================================================================
   SESSION HUB  —  sh-* namespace
   Standalone document: no Astra wrappers, full-width canvas.
   ================================================================ */

/* Page background */
.sh-page {
    background: #e6ddf0;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* Centred container — matches portal header inner width */
.sh-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 28px 0;
    box-sizing: border-box;
}

/* ── Session info card ────────────────────────────────────── */

.sh-card {
    background: #3E1E67;
    color: #fff;
    border-radius: 14px;
    padding: 28px 32px 24px;
    margin-bottom: 28px;
}

.sh-card__badge {
    display: inline-block;
    background: rgba(255,255,255,.15);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    margin: 0 0 10px;
}

.sh-card__title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px;
    line-height: 1.2;
}

.sh-card__date {
    font-size: .88rem;
    color: rgba(255,255,255,.7);
    margin: 0 0 18px;
}

.sh-card__foot {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.sh-card__welcome {
    font-size: .9rem;
    color: rgba(255,255,255,.9);
}

.sh-leave {
    background: none;
    border: 1px solid rgba(255,255,255,.35);
    color: rgba(255,255,255,.8);
    padding: 5px 14px;
    border-radius: 6px;
    font-size: .78rem;
    cursor: pointer;
    transition: background .15s;
}
.sh-leave:hover { background: rgba(255,255,255,.1); }

/* ── Trainer notes ────────────────────────────────────────── */

.sh-notes {
    background: #fff8ed;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: .88rem;
    color: #b45309;
    margin-bottom: 28px;
}

/* ── Tools section ────────────────────────────────────────── */

.sh-tools { margin-top: 4px; }

.sh-tools__label {
    font-size: .78rem;
    font-weight: 700;
    color: #6b3fa0;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 0 0 14px;
}

/* List reset */
.sh-tools__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Tool row ─────────────────────────────────────────────── */

.sh-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: rgba(255,255,255,.72);
    border-radius: 10px;
    padding: 14px 18px;
    transition: background .15s;
}
.sh-row:hover { background: rgba(255,255,255,.9); }
.sh-row--soon { opacity: .6; }

.sh-row__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sh-row__title {
    font-size: .95rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
}

.sh-row__desc {
    font-size: .8rem;
    color: #6b7280;
    line-height: 1.4;
}

.sh-row__action { flex-shrink: 0; }

/* ── Button ───────────────────────────────────────────────── */

.sh-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 18px;
    background: #3E1E67;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .15s;
}
.sh-btn:hover { opacity: .85; }
.sh-btn--ghost {
    background: transparent;
    color: #6b7280 !important;
    border: 1px solid #e5e7eb;
    cursor: default;
}

.sh-empty {
    color: #6b7280;
    font-style: italic;
    margin-top: 8px;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 640px) {
    .sh-wrap { padding: 28px 16px 0; }
    .sh-card { padding: 22px 20px 20px; }
    .sh-card__title { font-size: 1.35rem; }
    .sh-row { flex-direction: column; align-items: flex-start; gap: 10px; }
    .sh-btn { width: 100%; justify-content: center; }
}

/* ── Reflections Modal ─────────────────────────────────────────────────────── */

.td-refl-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 10, 40, .55);
    z-index: 99998;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.td-refl-overlay--active { display: flex; }

.td-refl-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    width: 100%;
    max-width: 660px;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.td-refl-modal__head {
    background: linear-gradient(135deg, #3E1E67, #6b2fa0);
    color: #fff;
    padding: 18px 22px 14px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.td-refl-modal__name {
    font-size: .95rem;
    font-weight: 800;
    margin: 0 0 3px;
}
.td-refl-modal__meta {
    font-size: .76rem;
    opacity: .8;
    margin: 0;
}
.td-refl-modal__close {
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: .9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
}
.td-refl-modal__close:hover { background: rgba(255,255,255,.35); }

.td-refl-modal__body {
    overflow-y: auto;
    padding: 18px 22px 22px;
    flex: 1;
}

.td-refl-loading,
.td-refl-empty {
    color: #9a8cbf;
    font-style: italic;
    text-align: center;
    padding: 24px 0;
    margin: 0;
}

.td-refl-answer {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #ede8f8;
}
.td-refl-answer:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.td-refl-answer__label {
    font-size: .7rem;
    font-weight: 700;
    color: #6b2fa0;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 4px;
}
.td-refl-answer__value {
    font-size: .86rem;
    color: #2d1b5e;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.td-refl-answer--decision .td-refl-answer__value {
    background: #f0ecfb;
    border-left: 3px solid #6b2fa0;
    padding: 7px 11px;
    border-radius: 0 7px 7px 0;
    font-weight: 600;
}
