.d4-leave-status {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.d4-leave-status__title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 4px 0 5px;
    margin: 0 0 2px;
    border-bottom: 2px solid transparent;
}

.d4-leave-status__title--primary {
    color: #0ab39c;
    border-color: #0ab39c;
}

.d4-leave-status__title--secondary {
    color: #5a7bb5;
    border-color: #5a7bb5;
}

.d4-leave-status__title--toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    background: transparent;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    border-radius: 0;
    text-align: left;
    cursor: pointer;
    padding: 6px 0;
    margin: 0;
}

.d4-leave-status__title--toggle:hover {
    opacity: .9;
}

.d4-leave-status__title--toggle.is-open .d4-leave-status__chevron {
    transform: rotate(90deg);
}

.d4-leave-status__title-left {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.d4-leave-status__title-transfer {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: #5a7bb5;
    white-space: nowrap;
}

.d4-leave-status__section--collapsed .d4-leave-status__body {
    display: none;
    margin-top: 2px;
}

.d4-leave-status__section--collapsed.is-open .d4-leave-status__body {
    display: block;
}

.d4-leave-status__rows {
    display: flex;
    flex-direction: column;
}

.d4-leave-status__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12.5px;
    border-bottom: 1px solid #f3f5fb;
}

.d4-leave-status__row:last-child {
    border-bottom: none;
}

.d4-leave-status__row span {
    color: #6b7fa3;
}

.d4-leave-status__row strong {
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
}

.d4-leave-status__row:has(+ .d4-leave-status__row--accent),
.d4-leave-status__row:has(+ .d4-leave-status__used-detail),
.d4-leave-status__row:has(+ .d4-leave-status__row--expired) {
    border-bottom: none;
}

.d4-leave-status__row--accent {
    border-top: 1px solid #dde6f2;
    padding-top: 6px;
}

.d4-leave-status__row--accent span,
.d4-leave-status__row--accent strong {
    font-weight: 700;
}

.d4-leave-status__row--accent span {
    color: #2d3748;
}

.d4-leave-status__row--expired {
    padding-top: 2px;
}

.d4-leave-status__used-toggle.is-expandable {
    cursor: pointer;
    user-select: none;
}

.d4-leave-status__used-toggle.is-expandable:hover span {
    color: #405a8a;
}

.d4-leave-status__chevron {
    display: inline-block;
    width: 12px;
    font-size: 10px;
    transition: transform .15s ease;
}

.d4-leave-status__used-toggle.is-open .d4-leave-status__chevron {
    transform: rotate(90deg);
}

.d4-leave-status__used-detail {
    display: none;
    margin: 0 0 4px;
    padding: 4px 0 4px 16px;
    border-left: 2px solid #e8eef8;
}

.d4-leave-status__used-detail.is-open {
    display: block;
}

.d4-leave-status__used-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 12px;
    border-bottom: 1px solid #f3f5fb;
}

.d4-leave-status__used-item:last-child {
    border-bottom: none;
}

.d4-leave-status__used-item span {
    color: #7a8bab;
}

.d4-leave-status__used-item strong {
    font-weight: 600;
    color: #4a5568;
    white-space: nowrap;
}

.d4-leave-status__validity {
    font-size: 10px;
    color: #9ba9c3;
    text-align: right;
    padding-top: 4px;
    font-style: italic;
}

.d4-leave-status__section--pending .d4-leave-status__row {
    border-bottom: none;
    border-top: 1px dashed #cfe0f5;
    padding-top: 8px;
}

/* ===== Modern theme ===== */
.d4-leave-status--modern {
    font-family: inherit;
    color: #1f2a44;
}

.d4ls-modern {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 4px;
    background: transparent;
}

.d4ls-modern__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.d4ls-modern__identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.d4ls-modern__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #3d4556;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.d4ls-modern__name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.d4ls-modern__name {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a2336;
    line-height: 1.2;
}

.d4ls-modern__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    color: #8a95a8;
}

.d4ls-modern__meta i {
    margin-right: 2px;
}

.d4ls-modern__dot {
    opacity: .7;
}

.d4ls-modern__badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.d4ls-modern__badge--success {
    background: #e7f8ef;
    color: #1f9d63;
}

.d4ls-modern__badge--transfer {
    background: #fff1e6;
    color: #d97706;
}

.d4ls-modern__badge--used {
    background: #fff1e6;
    color: #d97706;
}

.d4ls-modern__year-head-days--used {
    color: #d97706;
}

.d4ls-modern__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8a95a8;
    cursor: pointer;
    flex-shrink: 0;
}

.d4ls-modern__close:hover {
    background: #eef1f7;
    color: #40506a;
}

.d4ls-modern__summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.d4ls-modern__summary-card {
    background: #fff;
    border: 1px solid #e7ecf4;
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 4px 14px rgba(31, 42, 68, 0.04);
}

.d4ls-modern__summary-card--available {
    background: linear-gradient(145deg, #1f9d6a 0%, #168a5a 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 24px rgba(22, 138, 90, 0.28);
}

.d4ls-modern__summary-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    opacity: .85;
}

.d4ls-modern__summary-card--available .d4ls-modern__summary-label {
    opacity: .92;
}

.d4ls-modern__summary-value {
    margin-top: 8px;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
}

.d4ls-modern__summary-sub {
    margin-top: 6px;
    font-size: 12px;
    color: #8a95a8;
}

.d4ls-modern__summary-card--available .d4ls-modern__summary-sub {
    color: rgba(255, 255, 255, 0.85);
}

.d4ls-modern__summary-sub--pending {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #3b82f6;
}

.d4ls-modern__status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3b82f6;
    flex-shrink: 0;
}

.d4ls-modern__years {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.d4ls-modern__year {
    background: #fff;
    border: 1px solid #e7ecf4;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(31, 42, 68, 0.05);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.d4ls-modern__year-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.d4ls-modern__year-head-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.d4ls-modern__year-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
    background: #e8f1ff;
    color: #3b6fd9;
}

.d4ls-modern__year--old .d4ls-modern__year-badge {
    background: #eef1f6;
    color: #6b778c;
}

.d4ls-modern__year-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a2336;
}

.d4ls-modern__year-sub {
    margin-top: 2px;
    font-size: 12px;
    color: #8a95a8;
}

.d4ls-modern__year-sub.is-danger {
    color: #dc2626;
    font-weight: 600;
}

.d4ls-modern__progress-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 12px;
    color: #6b778c;
    margin-bottom: 8px;
}

.d4ls-modern__progress-top strong {
    color: #1a2336;
    font-size: 13px;
}

.d4ls-modern__progress-bar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #eef2f7;
}

.d4ls-modern__progress-used {
    display: block;
    height: 100%;
    background: #f59e0b;
}

.d4ls-modern__progress-free {
    display: block;
    height: 100%;
    background: #14b8a6;
}

.d4ls-modern__progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    font-size: 11px;
    color: #8a95a8;
}

.d4ls-modern__lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.d4ls-modern__line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.d4ls-modern__line span {
    color: #6b778c;
}

.d4ls-modern__line strong {
    color: #1a2336;
    font-weight: 600;
    white-space: nowrap;
}

.d4ls-modern__line--expired span,
.d4ls-modern__line--expired strong {
    color: #dc2626;
}

.d4ls-modern__remain {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 14px;
    padding: 12px 14px;
}

.d4ls-modern__remain--new {
    background: #eef5ff;
}

.d4ls-modern__remain--old {
    background: #fff4e8;
}

.d4ls-modern__remain-label {
    font-size: 13px;
    font-weight: 700;
    color: #1a2336;
}

.d4ls-modern__remain-hint {
    margin-top: 2px;
    font-size: 11px;
    color: #8a95a8;
}

.d4ls-modern__remain-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.85);
    color: #1a2336;
}

.d4ls-modern__remain--new .d4ls-modern__remain-value {
    color: #2563eb;
}

.d4ls-modern__remain--old .d4ls-modern__remain-value {
    color: #d97706;
}

.d4ls-modern__warning {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #dc2626;
}

.d4ls-modern__requests {
    background: #fff;
    border: 1px solid #e7ecf4;
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: 0 4px 14px rgba(31, 42, 68, 0.04);
}

.d4ls-modern__requests-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.d4ls-modern__requests-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #40506a;
}

.d4ls-modern__requests-count {
    font-size: 12px;
    color: #8a95a8;
}

.d4ls-modern__requests-empty {
    font-size: 13px;
    color: #8a95a8;
    padding: 8px 0;
}

.d4ls-modern__request {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #eef5ff;
    text-decoration: none !important;
    color: inherit;
    transition: background .15s ease;
}

.d4ls-modern__request:hover {
    background: #e4efff;
    color: inherit;
}

.d4ls-modern__request-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #3b6fd9;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.d4ls-modern__request-body {
    flex: 1;
    min-width: 0;
}

.d4ls-modern__request-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.d4ls-modern__request-top strong {
    font-size: 14px;
    color: #1a2336;
}

.d4ls-modern__request-days {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 999px;
    background: #dbeafe;
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
}

.d4ls-modern__request-sub {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: #d97706;
}

.d4ls-modern__request-chevron {
    color: #8a95a8;
    flex-shrink: 0;
}

.d4ls-modern__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.d4ls-modern__fresh {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6b778c;
}

.d4ls-modern__fresh-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
}

.d4ls-modern__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.d4ls-modern__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    border: 1px solid transparent;
    cursor: pointer;
    line-height: 1.2;
}

.d4ls-modern__btn--ghost {
    background: #fff;
    border-color: #d7deea;
    color: #40506a;
}

.d4ls-modern__btn--ghost:hover {
    background: #f5f7fb;
    color: #1a2336;
}

.d4ls-modern__btn--primary {
    background: #1e2a44;
    color: #fff !important;
    border-color: #1e2a44;
}

.d4ls-modern__btn--primary:hover {
    background: #162036;
    color: #fff !important;
}

@media (max-width: 767.98px) {
    .d4ls-modern__summary,
    .d4ls-modern__years {
        grid-template-columns: 1fr;
    }

    .d4ls-modern__summary-value {
        font-size: 24px;
    }

    .d4ls-modern__name {
        font-size: 16px;
    }

    .d4ls-modern__footer {
        align-items: stretch;
    }

    .d4ls-modern__actions {
        width: 100%;
    }

    .d4ls-modern__actions .d4ls-modern__btn {
        flex: 1;
    }

    .d4ls-modern__progress-top,
    .d4ls-modern__progress-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== Modern3 theme ===== */
.d4-leave-status--modern3 .d4ls-modern__summary--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.d4-leave-status--modern3 .d4ls-modern__years--stack {
    grid-template-columns: 1fr;
}

.d4ls-modern__year--collapsed {
    padding-top: 12px;
    padding-bottom: 12px;
}

.d4ls-modern__year--collapsed .d4ls-modern__year-body {
    display: none;
    margin-top: 14px;
}

.d4ls-modern__year--collapsed.is-open .d4ls-modern__year-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.d4ls-modern__year-head--toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.d4ls-modern__year-head--toggle:hover .d4ls-modern__year-title {
    color: #2563eb;
}

.d4ls-modern__year-head--toggle.is-open .d4-leave-status__chevron {
    transform: rotate(90deg);
}

.d4ls-modern__year-head-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.d4ls-modern__year-head-days {
    font-size: 13px;
    font-weight: 700;
    color: #d97706;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .d4-leave-status--modern3 .d4ls-modern__summary--two {
        grid-template-columns: 1fr;
    }
}

.d4ls-modern__used {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.d4ls-modern__line--used.is-expandable {
    cursor: pointer;
    user-select: none;
}

.d4ls-modern__line--used.is-expandable:hover span {
    color: #405a8a;
}

.d4ls-modern__line--used.is-open .d4-leave-status__chevron {
    transform: rotate(90deg);
}

.d4ls-modern__used-detail {
    display: none;
    margin: 0 0 2px;
    padding: 4px 0 4px 18px;
    border-left: 2px solid #e8eef8;
}

.d4ls-modern__used-detail.is-open {
    display: block;
}

.d4ls-modern__used-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    font-size: 12px;
    border-bottom: 1px solid #f3f5fb;
}

.d4ls-modern__used-item:last-child {
    border-bottom: none;
}

.d4ls-modern__used-item span {
    color: #7a8bab;
}

.d4ls-modern__used-item strong {
    color: #4a5568;
    font-weight: 600;
    white-space: nowrap;
}

/* Shared leave-status modal chrome (dashboard + codelist) */
.planner-leave-status-dialog .d4-modal-body {
    max-height: min(85vh, 860px);
    overflow-y: auto;
    text-align: left;
}

.planner-leave-status-dialog--modern .swal2-header,
.planner-leave-status-dialog--modern .d4-modal-header,
.planner-leave-status-dialog--modern .swal2-actions:empty,
.planner-leave-status-dialog--modern .swal2-close {
    display: none !important;
}

.planner-leave-status-dialog--modern .swal2-html-container,
.planner-leave-status-dialog--modern .d4-modal-body,
.planner-leave-status-dialog--modern .swal2-popup,
.planner-leave-status-dialog--modern.swal2-popup {
    margin: 0;
    padding: 16px 18px 18px;
    background: #fff !important;
}

.planner-leave-status-modal {
    padding: 0;
    background: #fff;
}

.planner-leave-status-modal .d4-leave-status--modern {
    max-width: 100%;
    background: #fff;
}

.planner-leave-status-modal .d4ls-modern {
    background: #fff;
}

