/* =============================================================================
   Agent Meeko - HR > Disciplinaries (RM-170)
   The page uses the Invoices tiles and the shared table; the case panel uses
   the shared record sections. This file holds the stage stepper, the pills,
   the actions, evidence and history lists.
   ============================================================================= */

/* ---- Page ------------------------------------------------------------------------- */
.hr-disciplinary .page-toolbar { padding: 0 var(--gutter) 0; flex-wrap: wrap; }
.hr-disciplinary .data-table-scroll { margin: 16px var(--gutter) 32px; }
.dis-filter { width: auto; min-width: 180px; height: var(--control-height-small); font-size: var(--font-size-small); }
.dis-table tbody tr { cursor: pointer; }
.dis-case { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dis-case__ref { font-size: var(--font-size-tiny); font-weight: 700; letter-spacing: .04em; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.dis-case__title { font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.dis-outcome { display: block; font-weight: 600; color: var(--text-primary); }
.dis-outcome__detail { display: block; font-size: var(--font-size-small); color: var(--text-secondary); }

/* ---- Stage pills -------------------------------------------------------------------- */
.dis-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: var(--font-size-small);
    font-weight: 600;
    white-space: nowrap;
}
.dis-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dis-pill--info { background: var(--status-info-tint); color: var(--status-info); }
.dis-pill--warning { background: var(--status-warning-tint); color: var(--status-warning); }
.dis-pill--accent { background: var(--accent-tint); color: var(--accent); }
.dis-pill--danger { background: var(--status-danger-tint); color: var(--status-danger); }
.dis-pill--neutral { background: var(--status-neutral-tint); color: var(--status-neutral); }

/* ---- Case panel ------------------------------------------------------------------------ */
.dis-muted { margin: 0; font-size: var(--font-size-small); color: var(--text-secondary); }
.dis-readonly { padding: 6px 0; }
.dis-stepper { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.dis-stepper__step { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; position: relative; color: var(--text-muted); }
.dis-stepper__step::after {
    content: '';
    position: absolute;
    top: 12px;
    left: calc(50% + 14px);
    right: calc(-50% + 14px);
    height: 2px;
    background: var(--border-default);
}
.dis-stepper__step:last-child::after { display: none; }
.dis-stepper__step.is-done::after { background: var(--accent); }
.dis-stepper__dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-default);
    background: var(--surface-panel);
    font-size: var(--font-size-tiny);
    font-weight: 700;
    position: relative;
    z-index: 1;
}
.dis-stepper__step.is-done .dis-stepper__dot { background: var(--accent); border-color: var(--accent); color: var(--surface-panel); }
.dis-stepper__step.is-current .dis-stepper__dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); }
.dis-stepper__step.is-current { color: var(--text-primary); }
.dis-stepper__label { font-size: var(--font-size-tiny); font-weight: 600; line-height: 1.25; }
.dis-stage-move { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dis-stage-move select { width: auto; min-width: 180px; height: var(--control-height-small); }

.dis-hearing { display: flex; flex-direction: column; gap: 12px; }
.dis-hearing__booked {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--accent-tint);
    color: var(--text-primary);
}
.dis-hearing__booked .icon { color: var(--accent); flex: none; }
.dis-hearing__actions { display: flex; justify-content: flex-end; }

/* Actions and evidence */
.dis-actions, .dis-files { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.dis-files > .am-btn { align-self: flex-start; }
.dis-actions__list, .dis-files__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-subtle); }
.dis-actions__item, .dis-files__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
}
.dis-actions__empty { padding: 12px 0; font-size: var(--font-size-small); color: var(--text-muted); }
.dis-actions__tick { padding-top: 2px; }
.dis-actions__main, .dis-files__main { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.dis-actions__title { font-weight: 600; color: var(--text-primary); }
.dis-actions__item.is-done .dis-actions__title { text-decoration: line-through; color: var(--text-muted); }
.dis-actions__detail, .dis-files__detail { font-size: var(--font-size-small); color: var(--text-secondary); }
.dis-actions__detail.is-overdue { color: var(--status-danger); font-weight: 600; }
.dis-actions__add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 160px) auto; gap: 8px; align-items: center; }
.dis-actions__add [data-title] { grid-column: 1 / -1; }
.dis-actions__add .form-field__control { height: var(--control-height-small); }
.dis-files__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--surface-subtle);
    color: var(--text-secondary);
}
.dis-files__name {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 600;
    color: var(--accent);
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dis-files__name:hover { text-decoration: underline; }
.dis-files__remove {
    flex: none;
    border: 1px solid var(--border-default);
    border-radius: 6px;
    background: var(--surface-panel);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.dis-files__remove:hover { color: var(--status-danger); border-color: var(--status-danger); }

.dis-letters__make { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dis-letters__make select { flex: 1 1 200px; width: auto; min-width: 0; height: var(--control-height-small); }

/* History */
.dis-history { display: flex; flex-direction: column; gap: 14px; }
.dis-history__composer { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.dis-history__composer textarea { width: 100%; }
.dis-history__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dis-history__item { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.dis-history__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface-subtle);
    color: var(--text-secondary);
}
.dis-history__item--note .dis-history__icon { background: var(--accent-tint); color: var(--accent); }
.dis-history__item--outcome .dis-history__icon, .dis-history__item--closed .dis-history__icon { background: var(--status-success-tint); color: var(--status-success); }
.dis-history__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dis-history__text { margin: 0; color: var(--text-primary); white-space: pre-wrap; overflow-wrap: anywhere; }
.dis-history__item--note .dis-history__text { font-weight: 500; }
.dis-history__meta { font-size: var(--font-size-small); color: var(--text-muted); }

/* ---- Employee tab ---------------------------------------------------------------------- */
.dis-tab__top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dis-tab__top .invoice-widgets { flex: 1 1 360px; margin: 0; }
.dis-tab__table { margin-top: 14px; }

/* ---- Tablet and phone ------------------------------------------------------------------- */
@media (max-width: 900px) {
    .dis-table__optional { display: none; }
}
@media (max-width: 560px) {
    .hr-disciplinary .page-toolbar { padding: 0 16px; }
    .hr-disciplinary .data-table-scroll { margin-left: 16px; margin-right: 16px; }
    .dis-filter { flex: 1 1 100%; }
    .dis-stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 12px; }
    .dis-stepper__step:nth-child(3)::after { display: none; }
    .dis-case__title { max-width: 180px; }
}
