/* Hiring suite (admin): positions toggles, applicant email thread, interview slots. */

/* --- Open positions toggles --- */
.ws-hiring-positions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.ws-hiring-position {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.ws-hiring-position--paused {
    background: #f9fafb;
}

.ws-hiring-position__title {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 0;
}

.ws-hiring-position--paused .ws-hiring-position__title {
    color: #6b7280;
}

.ws-hiring-position__pill {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 9px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
}

.ws-hiring-position--paused .ws-hiring-position__pill {
    background: #f3f4f6;
    color: #6b7280;
}

/* --- Unread applicant reply badge (applications list) --- */
.ws-hiring-reply-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #9c1c34;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

/* --- Email thread (application view) --- */
.ws-hiring-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 14px 0;
    max-width: 56rem;
}

.ws-hiring-msg {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    max-width: 85%;
}

.ws-hiring-msg--out {
    align-self: flex-end;
    background: #fdf5f6;
    border-color: #ecccd3;
}

.ws-hiring-msg--in {
    align-self: flex-start;
    background: #f8fafc;
}

.ws-hiring-msg__meta {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.ws-hiring-msg__subject {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.ws-hiring-msg__body {
    font-size: 0.88rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.ws-hiring-msg--unread {
    border-color: #9c1c34;
    box-shadow: 0 0 0 1px rgba(156, 28, 52, 0.25);
}

/* --- Compose box --- */
.ws-hiring-compose {
    max-width: 56rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    background: #fff;
}

.ws-hiring-compose label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.ws-hiring-compose input[type="text"],
.ws-hiring-compose textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font: inherit;
    margin-bottom: 10px;
}

.ws-hiring-compose textarea {
    min-height: 120px;
    resize: vertical;
}

/* --- Interview slots --- */
.ws-hiring-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.ws-hiring-slot {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    font-size: 0.85rem;
}

.ws-hiring-slot--booked {
    background: #fdf5f6;
    border-color: #ecccd3;
}

.ws-hiring-slot__when {
    font-weight: 700;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ws-hiring-slot__when span {
    font-weight: 500;
    color: #374151;
}

.ws-hiring-slot__notes {
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 400;
}

.ws-hiring-slot__status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.ws-hiring-slot__status form {
    margin: 0;
}

.ws-hiring-slot__pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #dcfce7;
    color: #166534;
}

.ws-hiring-slot__pill--booked {
    background: #fee2e2;
    color: #9c1c34;
}

.ws-hiring-slot__loc {
    color: #6b7280;
    font-size: 0.78rem;
    margin: 2px 0 6px;
}

.ws-hiring-slot__booked {
    color: #9c1c34;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.ws-hiring-slot-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    margin-top: 10px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    max-width: 56rem;
}

.ws-hiring-slot-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.82rem;
    font-weight: 600;
}

.ws-hiring-slot-form input {
    padding: 7px 9px;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    font: inherit;
}

.ws-hiring-slot-form__row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.ws-hiring-slot-form__notes {
    flex: 1 1 100%;
}

.ws-hiring-slot-form__notes input {
    width: 100%;
    box-sizing: border-box;
}

/* --- Mobile --- */
@media (max-width: 768px) {
    /* The legacy admin.css sets ".btn { width: 100% }" on phones, which crushes
       the position title to one letter per line. Keep these buttons inline. */
    .ws-hiring-position .btn,
    .ws-hiring-slot__status .btn,
    .ws-hiring-thread .btn {
        width: auto;
    }

    .ws-hiring-positions,
    .ws-hiring-slots {
        grid-template-columns: 1fr;
    }

    .ws-hiring-msg {
        max-width: 100%;
    }

    .ws-hiring-slot-form label {
        flex: 1 1 45%;
    }

    .ws-hiring-slot-form input {
        width: 100%;
        box-sizing: border-box;
    }
}

/* --- Interview status chip on the application view --- */
.ws-hiring-interview-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #f3f4f6;
    color: #374151;
}

.ws-hiring-interview-status--booked {
    background: #dcfce7;
    color: #166534;
}

/* ——— Dark mode — card surfaces/borders/text flip; status chips keep their hue. ——— */
html[data-ws-theme="dark"] .ws-hiring-position,
html[data-ws-theme="dark"] .ws-hiring-msg,
html[data-ws-theme="dark"] .ws-hiring-slot,
html[data-ws-theme="dark"] .ws-hiring-slot-form,
html[data-ws-theme="dark"] .ws-hiring-compose { background: #161a20; border-color: #2b323d; color: #e5e7eb; }
html[data-ws-theme="dark"] .ws-hiring-position--paused,
html[data-ws-theme="dark"] .ws-hiring-msg--in { background: #1b2026; }
html[data-ws-theme="dark"] .ws-hiring-msg--out { background: #2a1820; border-color: #4a2630; }
html[data-ws-theme="dark"] .ws-hiring-position--paused .ws-hiring-position__title,
html[data-ws-theme="dark"] .ws-hiring-msg__meta,
html[data-ws-theme="dark"] .ws-hiring-slot__notes,
html[data-ws-theme="dark"] .ws-hiring-slot__loc { color: #9ca3af; }
html[data-ws-theme="dark"] .ws-hiring-position--paused .ws-hiring-position__pill { background: #232a33; color: #9ca3af; }
html[data-ws-theme="dark"] .ws-hiring-interview-status { background: #232a33; color: #d1d5db; }
html[data-ws-theme="dark"] .ws-hiring-compose input,
html[data-ws-theme="dark"] .ws-hiring-compose textarea,
html[data-ws-theme="dark"] .ws-hiring-slot-form input,
html[data-ws-theme="dark"] .ws-hiring-slot-form textarea { background: #1b2026; border-color: #2b323d; color: #e5e7eb; }
