/* Small shared text and state helpers: muted text, warning colours, section titles, .hide. */

.hide {
    display: none;
}

.sec-title {
    margin: 0 0 8px;
    font-size: var(--fs-lg);
    font-weight: 700;
}

.empty {
    color: var(--muted-ink);
    padding: 30px 4px;
}

/* A friendlier "nothing here" panel — an icon, a bold line, a quieter one
   under it — used wherever a list or table has no rows to show. Built with
   the app's existing tokens so it drops into any page without extra setup;
   see emptyState() in common/render.js for the markup this styles. */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
    padding: 34px 20px;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--r-lg);
    background: var(--surface-2);
}

.empty-state .es-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface-3);
    color: var(--muted-ink);
    font-size: var(--fs-lg);
    margin-bottom: 5px;
}

.empty-state .es-title {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--ink-2);
}

.empty-state .es-sub {
    font-size: var(--fs-xs);
    color: var(--muted-ink);
    max-width: 380px;
}

/* One line, for a list that is often empty and should not take a screenful to say so
   (the Manager Review lists): the mark, the title and the note side by side. */
.empty-state.es-slim {
    flex-direction: row;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    text-align: left;
}

.empty-state.es-slim .es-icon {
    width: 20px;
    height: 20px;
    margin-bottom: 0;
    font-size: var(--fs-2xs);
}

.empty-state.es-slim .es-sub {
    max-width: none;
}

.empty-state.es-slim .es-sub::before {
    content: "\00b7";
    margin-right: 6px;
}

/* Inside a table row (a colspan cell replacing the usual rows) — text only,
   no box, so it reads as part of the table rather than a floating panel. */
.empty-state.es-row {
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    padding: 22px 4px;
    border: none;
    background: none;
}

.empty-state.es-row .es-icon {
    width: 22px;
    height: 22px;
    font-size: var(--fs-xs);
    margin-bottom: 0;
    background: none;
}

.empty-state.es-row .es-sub {
    margin-left: 2px;
}

.muted {
    color: var(--muted-ink);
    font-size: var(--fs-sm);
}

.warnline {
    font-size: var(--fs-xs);
    margin-top: 3px;
}

.w-red {
    color: var(--danger-ink);
}

.w-amber {
    color: var(--warning-ink);
}

.w-plum {
    color: var(--plum-ink);
}

/* A section title that starts a new block further down the page. */
.sec-title.sec-title-spaced {
    margin-top: 20px;
}

.w-green {
    color: var(--success-ink);
}

/* Anything clickable that is not a button or a link (icon actions, a clickable title). */
.cursor-pointer {
    cursor: pointer;
}

/* An avatar followed by a name, kept on one line and centred on each other. */
.av-label {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.av-label.av-label-wide {
    gap: 8px;
}

/* Smaller muted sub-lines under a table cell's main value. */
.muted.fs-11 {
    font-size: var(--fs-2xs);
}

.muted.fs-11-5 {
    font-size: var(--fs-xs);
}

.muted.fs-10-5 {
    font-size: var(--fs-2xs);
}

/* ─────────────────────────────────────────────────────────────
   The ⓘ beside a label (infoIcon() in render.js, or written by hand
   with data-tip / data-tip-title) and the card it opens (patTip).
   The same look as the help cards in the issue form.
   ───────────────────────────────────────────────────────────── */
.info-i {
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
    font: italic 700 11px/1 Georgia, "Times New Roman", serif;
    color: var(--muted-ink);
    text-transform: none;
    letter-spacing: 0;
    vertical-align: middle;
    cursor: help;
    user-select: none;
    transition: color .15s, border-color .15s, background .15s;
}
.info-i:hover,
.info-i:focus-visible {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    outline: none;
}

.pat-tip {
    position: fixed;
    z-index: 3000;
    display: none;
    width: max-content;
    max-width: min(320px, calc(100vw - 24px));
    min-width: 220px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: 0 16px 32px -8px rgba(16, 24, 40, .18), 0 4px 8px -4px rgba(16, 24, 40, .08);
    font-family: var(--font-sans);
    text-align: left;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease;
    pointer-events: none;
}
.pat-tip--above { transform: translateY(4px); }
.pat-tip--on { opacity: 1; transform: none; }
/* the arrow pointing at the icon */
.pat-tip::before {
    content: "";
    position: absolute;
    top: -6px;
    left: var(--arrow-x, 16px);
    width: 10px;
    height: 10px;
    border-top: 1px solid var(--primary-soft-2);
    border-left: 1px solid var(--primary-soft-2);
    background: var(--primary-soft);
    transform: rotate(45deg);
}
.pat-tip--above::before {
    top: auto;
    bottom: -6px;
    border: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}
/* no title: the arrow sits on the white body */
.pat-tip:not(:has(.pat-tip__head))::before {
    border-color: var(--line);
    background: var(--surface);
}
.pat-tip__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    background: linear-gradient(135deg, var(--primary-soft) 0%, var(--plum-soft) 100%);
    border-bottom: 1px solid var(--primary-soft-2);
}
.pat-tip__badge {
    flex: none;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font: italic 700 13px/1 Georgia, "Times New Roman", serif;
    box-shadow: 0 2px 6px rgba(79, 70, 229, .35);
}
.pat-tip__head strong {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--primary-ink);
    line-height: var(--lh-tight);
}
.pat-tip__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-regular);
    line-height: var(--lh-snug);
    color: var(--ink-3);
    white-space: normal;
}
.pat-tip__body p { margin: 0; }
.pat-tip__rows {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    overflow: hidden;
}
.pat-tip__rows li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    color: var(--ink-2);
}
.pat-tip__rows li + li { border-top: 1px solid var(--line); }
.pat-tip__rows li:nth-child(even) { background: var(--surface-2); }
.pat-tip__chip {
    flex: none;
    min-width: 56px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-3);
    font-size: var(--fs-2xs);
    font-weight: var(--fw-semibold);
    color: var(--ink-2);
    text-align: center;
}
.pat-tip__chip--red    { background: var(--danger-soft);  color: var(--danger-ink); }
.pat-tip__chip--orange { background: var(--orange-soft);  color: var(--orange-ink); }
.pat-tip__chip--amber  { background: var(--warning-soft); color: var(--warning-ink); }
.pat-tip__chip--green  { background: var(--success-soft); color: var(--success-ink); }
.pat-tip__chip--blue   { background: var(--info-soft);    color: var(--info-ink); }

/* ─────────────────────────────────────────────────────────────
   The app's tooltip for title="…" (patTitle in render.js): a small
   dark label that wraps long text, with a pointer at the element.
   ───────────────────────────────────────────────────────────── */
.pat-tt {
    position: fixed;
    z-index: 3100;
    display: none;
    max-width: min(360px, calc(100vw - 16px));
    padding: 6px 10px;
    border-radius: var(--r-sm);
    background: #1D2939;
    box-shadow: 0 8px 20px -6px rgba(16, 24, 40, .35), 0 2px 6px -2px rgba(16, 24, 40, .2);
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    line-height: var(--lh-snug);
    color: #fff;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity .12s ease, transform .12s ease;
    pointer-events: none;
}
.pat-tt--above { transform: translateY(3px); }
.pat-tt--on { opacity: 1; transform: none; }
/* the pointer */
.pat-tt::before {
    content: "";
    position: absolute;
    top: -4px;
    left: var(--arrow-x, 50%);
    width: 8px;
    height: 8px;
    margin-left: -4px;
    background: #1D2939;
    transform: rotate(45deg);
}
.pat-tt--above::before {
    top: auto;
    bottom: -4px;
}
