/**
 * MVD Time Off — v0.1.2
 * Styles for the employee widget, manager grid, and modals.
 */

/* ─── Employee widget ─────────────────────────────────────────── */

/* Dashboard widget — no card container/borders/shadow; Kadence provides the
   outer card, title and padding (matches the [mvd_clock_punch_widget] philosophy).
   Centered + max-width to visually align with the My Shift widget column. */
.mvd-timeoff-widget {
    max-width: 360px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1d2327;
}

/* ─── Action button ─── Matches the My Shift "View Timecard" self-service
   button: same width, height, border-radius, margins and spacing so the two
   dashboard widgets read as one family. */
.mvd-timeoff-widget__action {
    display: flex;
    margin: 0;
}

.mvd-timeoff-new-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.mvd-timeoff-new-btn:hover {
    background: #eef2f7;
    border-color: #94a3b8;
}

.mvd-timeoff-new-btn i {
    margin-right: 2px;
}

/* ─── Empty state ─── */
.mvd-timeoff-empty {
    color: #64748b;
    margin: 0;
    padding: 10px 0;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ─── Grouped sections (Upcoming / Pending) ─── */
.mvd-to-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.mvd-to-group:last-child {
    margin-bottom: 0;
}

.mvd-to-group__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    padding: 2px 0 4px;
}

/* ─── Minimal request rows ─── */
.mvd-to-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    line-height: 1.4;
}

.mvd-to-row:last-child {
    border-bottom: none;
}

.mvd-to-row__date {
    font-weight: 600;
    color: #1d2327;
    min-width: 92px;
}

.mvd-to-row__label {
    color: #50575e;
    flex: 1;
}

.mvd-to-cancel-btn {
    background: none;
    border: none;
    color: #b32d2e;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
    transition: background 0.15s ease;
}

.mvd-to-cancel-btn:hover {
    background: #fdecee;
}

/* ─── Status badges ───────────────────────────────────────────── */

.mvd-to-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: capitalize;
    line-height: 1.6;
}

.mvd-to-badge--approved  { background: #e6f4f1; color: #1a7d72; }
.mvd-to-badge--pending   { background: #fef8e7; color: #8a6d1a; }
.mvd-to-badge--denied    { background: #fdecee; color: #b3261e; }
.mvd-to-badge--cancelled { background: #eceef0; color: #646970; }

/* ─── Escalate indicator (OM's own request) ──────────────────── */

.mvd-to-escalate {
    font-size: 0.8rem;
    color: #8a6d1a;
    font-style: italic;
}

.mvd-btn-link {
    background: none !important;
    border: none !important;
    color: #2271b1;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 8px;
}

/* ─── Manager grid ────────────────────────────────────────────── */

.mvd-timeoff-manager .mvd-toolbar {
    margin-bottom: 16px;
}

.mvd-to-review-btn {
    padding: 4px 10px !important;
    font-size: 0.82rem !important;
    margin: 0 2px;
}

/* ─── SweetAlert2 modal forms ─────────────────────────────────── */

.mvd-to-form {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mvd-to-form label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1d2327;
    text-align: left;
    margin-top: 6px;
}

.mvd-to-form__row {
    display: flex;
    gap: 12px;
}

.mvd-to-form__row > div {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mvd-to-form__row .swal2-input {
    margin: 4px 0 0;
    width: 100%;
}

.mvd-to-form .swal2-select,
.mvd-to-form .swal2-input,
.mvd-to-form .swal2-textarea {
    margin: 4px auto;
}

.mvd-to-review-info {
    text-align: left;
    margin: 0 0 12px;
}

.mvd-to-review-info p {
    margin: 4px 0;
    font-size: 0.9rem;
}

/* ─── Responsive ──────────────────────────────────────────────── */

/* On small screens the centered widget column never exceeds the viewport, so
   there is no horizontal overflow. Rows keep a clean line layout; the status
   badge and cancel control sit alongside the label without forcing a wrap. */
@media (max-width: 600px) {
    .mvd-timeoff-widget {
        max-width: 100%;
    }

    .mvd-to-row {
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
    }

    .mvd-to-row__date {
        min-width: 0;
        white-space: nowrap;
    }

    .mvd-to-row__label {
        min-width: 0;
        flex: 1 1 auto;
    }

    .mvd-to-form__row {
        flex-direction: column;
        gap: 6px;
    }
}
