/* ============================================================
   Leave Approvals screen (redesign) - cards, summary tiles, filters.
   Loaded last (see Core/templates/_styles.html). Scoped with .lap-* so
   nothing else in ADS is affected.
   ============================================================ */

.lap-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.lap-tile {
    display: flex; align-items: center; gap: 12px;
    background: var(--white); border: 1px solid var(--gray-200); border-radius: 12px;
    padding: 12px 14px; box-shadow: var(--shadow-sm);
}
.lap-tile-ic {
    width: 38px; height: 38px; border-radius: 10px; flex: 0 0 38px;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.lap-tile-ic.amber  { background: #fef3c7; color: #b45309; }
.lap-tile-ic.green  { background: #dcfce7; color: #15803d; }
.lap-tile-ic.blue   { background: #dbeafe; color: #1d4ed8; }
.lap-tile-ic.violet { background: #ede9fe; color: #6d28d9; }
.lap-tile-ic.slate  { background: #e2e8f0; color: #334155; }
.lap-tile-num { font-size: 20px; font-weight: 700; color: var(--gray-900); line-height: 1.1; }
.lap-tile-lbl { font-size: 12px; color: var(--gray-600); margin-top: 2px; }

.lap-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px;
}
.lap-search {
    position: relative; flex: 1 1 240px; min-width: 200px;
}
.lap-search i {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--gray-400); font-size: 13px; pointer-events: none;
}
.lap-search input {
    width: 100%; height: 38px; padding: 0 12px 0 34px;
    border: 1px solid var(--gray-200); border-radius: 10px; background: var(--white);
    font-size: 13.5px; color: var(--text); outline: none;
}
.lap-search input:focus, .lap-sort:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(14, 161, 111, .15); }
.lap-seg { display: inline-flex; background: var(--gray-100); border-radius: 10px; padding: 3px; }
.lap-seg-btn {
    border: 0; background: transparent; padding: 7px 14px; border-radius: 8px;
    font-size: 13px; color: var(--gray-700); cursor: pointer; font-weight: 500;
}
.lap-seg-btn:hover { color: var(--gray-900); }
.lap-seg-btn.active { background: var(--white); color: var(--green-dark); font-weight: 600; box-shadow: var(--shadow-sm); }
.lap-sort {
    height: 38px; padding: 0 10px; border: 1px solid var(--gray-200); border-radius: 10px;
    background: var(--white); font-size: 13px; color: var(--text); outline: none;
}
.lap-refresh {
    width: 38px; height: 38px; border: 1px solid var(--gray-200); border-radius: 10px;
    background: var(--white); color: var(--gray-700); cursor: pointer;
}
.lap-refresh:hover { color: var(--green-dark); border-color: var(--green); }

.lap-list { display: flex; flex-direction: column; gap: 10px; }
.lap-card {
    display: grid;
    grid-template-columns: minmax(170px, 1.1fr) minmax(200px, 1.2fr) minmax(160px, 1.6fr) auto;
    align-items: center; gap: 18px;
    background: var(--white); border: 1px solid var(--gray-200); border-radius: 12px;
    padding: 14px 18px; box-shadow: var(--shadow-sm);
    transition: box-shadow .15s ease, border-color .15s ease;
}
.lap-card:hover { box-shadow: var(--shadow-md); border-color: #cbd5e1; }

.lap-emp { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lap-avatar {
    width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--green-lite); color: var(--green-dark); font-weight: 700; font-size: 14px;
    border: 1px solid var(--green-mid);
}
.lap-emp-txt { min-width: 0; }
.lap-emp-name { font-weight: 600; color: var(--gray-900); font-size: 14.5px; overflow-wrap: anywhere; }
.lap-emp-sub { font-size: 12px; color: var(--gray-600); margin-top: 2px; }

.lap-when { min-width: 0; }
.lap-pill {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .02em; margin-bottom: 5px;
}
.lap-pill.leave { background: #dcfce7; color: #166534; }
.lap-pill.perm  { background: #dbeafe; color: #1e40af; }
.lap-date { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.lap-past {
    display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px;
    background: #f1f5f9; color: var(--gray-600); font-size: 11px; font-weight: 600; vertical-align: middle;
}
.lap-detail { font-size: 12.5px; color: var(--gray-600); margin-top: 2px; }
.lap-detail b { color: var(--gray-900); }

.lap-reason {
    font-size: 13.5px; color: var(--gray-700); line-height: 1.45; min-width: 0;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    overflow-wrap: anywhere;
}
.lap-muted { color: var(--gray-400); font-style: italic; }

.lap-actions { display: flex; gap: 8px; justify-content: flex-end; }
.lap-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 14px; border-radius: 9px; cursor: pointer;
    border: 1px solid var(--gray-200); background: var(--white); color: var(--gray-700);
    font-size: 13px; font-weight: 600; white-space: nowrap;
}
.lap-btn:disabled { opacity: .55; cursor: not-allowed; }
.lap-btn-approve { background: var(--green); border-color: var(--green); color: #fff; }
.lap-btn-approve:hover:not(:disabled) { background: var(--green-dark); border-color: var(--green-dark); }
.lap-btn-reject { color: var(--red-dark); border-color: #fecaca; background: #fff; }
.lap-btn-reject:hover:not(:disabled) { background: #fef2f2; }
.lap-btn-reject.solid { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.lap-btn-reject.solid:hover:not(:disabled) { background: #b91c1c; }

.lap-foot { text-align: right; font-size: 12px; color: var(--gray-600); padding: 4px 4px 0; }

.lap-state {
    display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
    padding: 44px 16px; color: var(--gray-600); font-size: 13.5px;
    background: var(--white); border: 1px dashed var(--gray-200); border-radius: 12px;
}
.lap-state > i { font-size: 26px; color: var(--gray-400); }
.lap-state div { font-weight: 600; color: var(--gray-900); font-size: 15px; }
.lap-state-empty > i { color: var(--green); }
.lap-state-error { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
.lap-state-error > i { color: var(--red-dark); }

/* rejection dialog */
.lap-modal-ov {
    position: fixed; inset: 0; z-index: 10000; background: rgba(15, 23, 42, .45);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.lap-modal {
    width: 100%; max-width: 420px; background: var(--white); border-radius: 14px;
    padding: 20px; box-shadow: var(--shadow-lg);
}
.lap-modal h4 { margin: 0 0 2px; font-size: 16px; color: var(--gray-900); }
.lap-modal p { margin: 0 0 14px; font-size: 13px; color: var(--gray-600); }
.lap-modal label { display: block; font-size: 12.5px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.lap-modal textarea {
    width: 100%; resize: vertical; padding: 9px 11px; border: 1px solid var(--gray-200);
    border-radius: 10px; font: inherit; font-size: 13.5px; outline: none;
}
.lap-modal textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(14, 161, 111, .15); }
.lap-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

@media (max-width: 980px) {
    .lap-card { grid-template-columns: 1fr 1fr; }
    .lap-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 600px) {
    .lap-card { grid-template-columns: 1fr; gap: 12px; }
    .lap-actions .lap-btn { flex: 1; justify-content: center; }
    .lap-seg { width: 100%; }
    .lap-seg-btn { flex: 1; }
    .lap-sort { flex: 1 1 100%; }
}

/* WFH rows in the approvals list */
.lap-pill.wfh { background: #ccfbf1; color: #115e59; }
.lap-tile-ic.teal { background: #ccfbf1; color: #0f766e; }

/* ---------------- Work From Home (WFH) ---------------- */
.wfh-summary-card .lv-balance-bar-fill { background: linear-gradient(90deg, #14b8a6, #0ea16f); }
.wfh-card-notes { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--gray-700); }
.wfh-card-notes i { width: 14px; color: var(--gray-600); }
.wfh-note-muted { color: var(--gray-400); }
.wfh-apply-hint {
    background: #f0fdfa; border: 1px solid #99f6e4; color: #115e59; border-radius: 10px;
    padding: 9px 12px; font-size: 12.5px; margin-bottom: 12px; line-height: 1.5;
}
.wfh-credit-intro {
    background: var(--white); border: 1px solid var(--gray-200); border-radius: 12px;
    padding: 12px 16px; font-size: 13px; color: var(--gray-700); line-height: 1.55; margin-bottom: 14px;
}
.wfh-credit-quarter { font-weight: 600; color: var(--gray-900); font-size: 13.5px; margin: 2px 2px 8px; }
.wfh-credit-note { font-size: 12.5px; color: #92400e; margin: 0 2px 8px; }
.wfh-credit-note:empty { display: none; }
.wfh-credit-table td, .wfh-credit-table th { vertical-align: middle; }

/* WFH credit process switch (Manual / Automatic) */
.wfh-mode-card {
    background: var(--white); border: 1px solid var(--gray-200); border-radius: 12px;
    padding: 12px 16px; margin-bottom: 14px;
}
.wfh-mode-head { font-size: 13px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.wfh-mode-head i { color: var(--green); }
.wfh-mode-options { display: flex; gap: 10px; flex-wrap: wrap; }
.wfh-mode-opt {
    flex: 1 1 280px; display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px;
    border: 1.5px solid var(--gray-200); border-radius: 10px; cursor: pointer;
    font-size: 12.5px; color: var(--gray-700); line-height: 1.45; transition: border-color .15s, background .15s;
}
.wfh-mode-opt input { margin-top: 3px; accent-color: var(--green); }
.wfh-mode-opt:has(input:checked) { border-color: var(--green); background: var(--green-lite); }
.wfh-mode-opt.is-readonly { cursor: default; }
.wfh-mode-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; min-height: 4px; }
.wfh-mode-status { font-size: 12px; color: var(--gray-600); }


/* ---- My Work From Home Requests: compact, aligned table -------------------
   Scoped to .wfh-requests-table so the shared .tickets-table rules (fixed
   column widths meant for the ticket list) no longer squeeze this table. */
.wfh-requests-wrap { overflow-x: auto; }
.wfh-requests-table { table-layout: fixed; width: 100%; min-width: 640px; }
.wfh-requests-table th, .wfh-requests-table td { width: auto; padding: 9px 12px; vertical-align: middle; text-align: left; }
.wfh-requests-table th:nth-child(n), .wfh-requests-table td:nth-child(n) { width: auto; }
.wfh-requests-table col.wfh-c-date   { width: 21%; }
.wfh-requests-table col.wfh-c-dur    { width: 15%; }
.wfh-requests-table col.wfh-c-days   { width: 7%; }
.wfh-requests-table col.wfh-c-status { width: 12%; }
.wfh-requests-table col.wfh-c-appr   { width: 15%; }
.wfh-requests-table col.wfh-c-rem    { width: 20%; }
.wfh-requests-table col.wfh-c-act    { width: 10%; }
.wfh-requests-table td.wfh-cell-date,
.wfh-requests-table td.wfh-cell-nowrap { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wfh-requests-table td.wfh-cell-trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gray-700); }
.wfh-requests-table td.wfh-cell-days { font-variant-numeric: tabular-nums; }
.wfh-requests-table td.wfh-cell-action { text-align: right; }
.wfh-requests-table th:last-child { text-align: right; }
@media (max-width: 700px) {
    .wfh-requests-table th, .wfh-requests-table td { padding: 8px 8px; font-size: 12.5px; }
}
.wfh-requests-table thead th { padding: 9px 14px; white-space: nowrap; }
.wfh-requests-table tbody tr:hover { cursor: default; }
