/* CliManage Leave Management Styles */

.climanage-leave-management {
    padding: 0;
    max-width: 100%;
    min-width: 0; /* Allow overflow in flex parents */
}

/* Collapsible rows */
.leave-row-hidden {
    display: none !important;
}

.leave-show-more-wrap {
    padding: 16px;
    text-align: center;
    border-top: 1px solid var(--cliM-border-color, #e8e8e8);
}

.leave-show-more-btn {
    padding: 10px 24px;
    border: 1px solid var(--cliM-border-color, #ddd);
    border-radius: 8px;
    background: var(--background-color, #fff);
    color: var(--e-global-color-accent, #8672a3);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.leave-show-more-btn:hover {
    background: var(--hover-background, #f5f5f5);
}

/* Mobile FAB */
.leave-fab {
    display: none;
}

/* Bottom sheet (hidden by default) */
.leave-bottom-sheet {
    display: none;
}

.leave-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.leave-page-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color, #1a1a1a);
}

.year-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.year-selector label {
    margin: 0;
    font-size: 14px;
    color: var(--sub-color, #666);
}

.year-selector select {
    padding: 8px 12px;
    border: 1px solid var(--cliM-border-color, #ddd);
    border-radius: 4px;
    background: var(--hover-background, #fff);
    color: var(--color, #1a1a1a);
    font-size: 14px;
}

.leave-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.leave-card {
    background: var(--background-color, #fff);
    border: 1px solid var(--cliM-border-color, #e0e0e0);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.leave-card.general {
    border-left: 4px solid #2196F3;
}

.leave-card.restricted {
    border-left: 4px solid #FF9800;
}

.leave-card.casual {
    border-left: 4px solid #4CAF50;
}

.leave-card h3 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--sub-color, #666);
}

.leave-card .count {
    font-size: 1.75rem;
    font-weight: bold;
    margin: 0 0 4px 0;
    color: var(--color, #1a1a1a);
}

.leave-card .desc {
    margin: 0;
    font-size: 0.8rem;
    color: var(--sub-color, #888);
}

.leave-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.leave-section {
    background: var(--background-color, #fff);
    border: 1px solid var(--cliM-border-color, #e0e0e0);
    border-radius: 10px;
    padding: 20px;
}

.leave-section h2 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    color: var(--color, #1a1a1a);
}

.section-note {
    margin: 0 0 16px 0;
    font-size: 0.85rem;
    color: var(--sub-color, #666);
}

.rh-selection-count {
    display: inline-block;
    padding: 6px 12px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--e-global-color-accent, #8672a3);
    background: rgba(134, 114, 163, 0.1);
    border-radius: 8px;
}

.rh-list {
    list-style: none;
    margin: 0 0 16px 0;
    padding: 0;
}

.rh-list li {
    margin-bottom: 10px;
}

.rh-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 14px;
    border: 2px solid var(--cliM-border-color, #e0e0e0);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.rh-item:hover:not(.disabled) {
    background: var(--hover-background, #f8f8f8);
}

.rh-item.rh-item-selected {
    border-color: rgba(134, 114, 163, 0.5);
    background: rgba(134, 114, 163, 0.06);
}

.rh-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.rh-item input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 2px;
}

.rh-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rh-name {
    font-weight: 500;
    color: var(--color, #1a1a1a);
    line-height: 1.3;
}

.rh-date {
    font-size: 0.85rem;
    color: var(--sub-color, #666);
}

.climanage-button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.climanage-button:hover {
    opacity: 0.9;
}

.climanage-button.primary {
    background: #8672a3;
    color: #fff;
}

.climanage-button.small {
    padding: 6px 12px;
    font-size: 12px;
    margin-right: 6px;
}

.climanage-button.small:last-of-type {
    margin-right: 0;
}

.climanage-button.danger {
    background: #d32f2f;
    color: #fff;
}

.form-field.full-width {
    width: 100%;
}

.climanage-holiday-table,
.climanage-leave-table {
    margin-top: 12px;
}

/* Leave tabs */
.leave-tabs-container {
    margin-top: 24px;
    overflow: visible;
    min-width: 0; /* Allow flex child to shrink and show overflow */
}

.leave-tabs-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    margin-bottom: 0;
    border-bottom: 1px solid var(--cliM-border-color, #e0e0e0);
    padding: 0 4px 0 0;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.leave-tabs-nav::-webkit-scrollbar {
    height: 4px;
}

.leave-tab-btn {
    padding: 12px 20px;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--sub-color, #666);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px;
    flex-shrink: 0;
    white-space: nowrap;
}

.leave-tab-btn:hover {
    color: var(--color, #1a1a1a);
}

.leave-tab-btn.active {
    color: var(--e-global-color-accent, #8672a3);
    border-bottom-color: var(--e-global-color-accent, #8672a3);
}

.leave-tab-panel {
    display: none;
    padding: 20px 0 0;
}

.leave-tab-panel.active {
    display: block;
}

.leave-empty-msg {
    padding: 24px;
    text-align: center;
    color: var(--sub-color, #666);
    background: var(--hover-background, #fafafa);
    border-radius: 8px;
    margin: 12px 0 0;
}

/* Styled leave tables (My Leave Applications, Team Leave Overview) */
.leave-table-wrap {
    overflow: auto;
    max-height: 400px;
    border: 1px solid var(--cliM-border-color, #e0e0e0);
    border-radius: 8px;
    margin-top: 12px;
}

.climanage-leave-table-styled {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.climanage-leave-table-styled th,
.climanage-leave-table-styled td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--cliM-border-color, #e8e8e8);
    vertical-align: middle;
}

.climanage-leave-table-styled thead th {
    background: var(--hover-background, #f5f5f5);
    font-weight: 600;
    color: var(--color, #1a1a1a);
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: 0 1px 0 var(--cliM-border-color, #e8e8e8);
}

.climanage-leave-table-styled tbody td {
    background: var(--background-color, #fff);
}

.climanage-leave-table-styled tbody tr:nth-child(even) td {
    background: var(--hover-background, #fafafa);
}

.climanage-leave-table-styled tbody tr:last-child td {
    border-bottom: none;
}

.climanage-leave-table-styled .climanage-button.small {
    margin-right: 6px;
}

.climanage-leave-table-styled .climanage-button.small:last-child {
    margin-right: 0;
}

/* Holiday Settings tab - section separators & cards */
.holiday-settings-section {
    background: var(--background-color, #fff);
    border: 1px solid var(--cliM-border-color, #e0e0e0);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
}

.holiday-settings-section:last-child {
    margin-bottom: 0;
}

.holiday-settings-policy h2 {
    border-bottom-color: rgba(76, 175, 80, 0.4);
}

.holiday-settings-calendar h2 {
    border-bottom-color: rgba(33, 150, 243, 0.4);
}

.holiday-settings-custom h3 {
    border-bottom-color: rgba(255, 152, 0, 0.4);
}

/* Holiday Settings tab - match other settings tabs */
.climanage-holiday-settings .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 10px;
}

.climanage-holiday-settings .form-row .form-field {
    width: calc(50% - 5px);
    min-width: 150px;
}

.climanage-holiday-settings .form-row .form-field:last-child {
    width: auto;
}

.climanage-holiday-settings h2,
.climanage-holiday-settings h3 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    color: var(--color, #1a1a1a);
}

.holiday-settings-section h2,
.holiday-settings-section h3 {
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--cliM-border-color, #e8e8e8);
    font-size: 1.15rem;
}

.climanage-holiday-settings .description {
    margin: 0 0 16px 0;
    font-size: 0.9rem;
    color: var(--sub-color, #666);
}

.climanage-holiday-settings .form-control,
.climanage-holiday-list-table select.form-control {
    display: block;
    width: 100%;
    padding: var(--input-padding, 10px);
    border: 1px solid var(--cliM-border-color, #ddd);
    color: var(--sub-color, #666);
    border-radius: 4px;
    font-size: var(--input-font-size, 14px);
    background: var(--hover-background, #fff);
}

.climanage-holiday-list-table {
    margin-top: 16px;
    margin-bottom: 16px;
    border-collapse: collapse;
    width: 100%;
}

.climanage-holiday-list-table th,
.climanage-holiday-list-table td {
    padding: 10px 12px;
    border: 1px solid var(--cliM-border-color, #e0e0e0);
    text-align: left;
}

.climanage-holiday-list-table th {
    background: var(--hover-background, #f5f5f5);
    font-weight: 600;
}

.climanage-holiday-list-table td select {
    min-width: 120px;
}

.holiday-fetch-status {
    padding: 12px 16px;
    margin: 0 0 16px 0;
    border-radius: 4px;
    font-size: 14px;
}

.holiday-fetch-status.updated {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
}

.holiday-fetch-status.error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

#no-holidays-msg {
    margin: 0 0 16px 0;
    padding: 12px 16px;
    background: var(--hover-background, #f9f9f9);
    border: 1px solid var(--cliM-border-color, #e0e0e0);
    border-radius: 4px;
    font-size: 14px;
    color: var(--sub-color, #666);
}

.climanage-holiday-table tr.restricted {
    background: rgba(255, 152, 0, 0.08);
}

.climanage-holiday-table tr.general {
    background: rgba(33, 150, 243, 0.05);
}

/* Holiday Calendar table (leave page) */
.holiday-calendar-table-wrap {
    overflow: auto;
    max-height: 400px;
    border: 1px solid var(--cliM-border-color, #e0e0e0);
    border-radius: 8px;
    margin-top: 12px;
}

.climanage-holiday-calendar-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.climanage-holiday-calendar-table th,
.climanage-holiday-calendar-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--cliM-border-color, #e8e8e8);
    vertical-align: middle;
}

.climanage-holiday-calendar-table thead th {
    background: var(--hover-background, #f5f5f5);
    font-weight: 600;
    color: var(--color, #1a1a1a);
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: 0 1px 0 var(--cliM-border-color, #e8e8e8);
}

.climanage-holiday-calendar-table thead th:nth-child(2),
.climanage-holiday-calendar-table thead th:last-child {
    text-align: left;
}

.climanage-holiday-calendar-table tbody td {
    background: var(--background-color, #fff);
}

.climanage-holiday-calendar-table tbody td:nth-child(1),
.climanage-holiday-calendar-table tbody td:nth-child(3),
.climanage-holiday-calendar-table tbody td:nth-child(4),
.climanage-holiday-calendar-table tbody td:nth-child(5) {
    text-align: center;
}

.climanage-holiday-calendar-table tbody tr:nth-child(even) td {
    background: var(--hover-background, #fafafa);
}

.climanage-holiday-calendar-table tbody tr.restricted td {
    background: rgba(255, 152, 0, 0.12) !important;
}

.climanage-holiday-calendar-table tbody tr.restricted:nth-child(even) td {
    background: rgba(255, 152, 0, 0.18) !important;
}

.climanage-holiday-calendar-table tbody tr:last-child td {
    border-bottom: none;
}

.climanage-holiday-calendar-table tbody td:nth-child(2) {
    font-weight: 500;
    color: var(--color, #1a1a1a);
}

.climanage-holiday-calendar-table tbody td:nth-child(3),
.climanage-holiday-calendar-table tbody td:nth-child(4) {
    color: var(--sub-color, #666);
}

.climanage-holiday-calendar-table tbody td:nth-child(5) {
    font-size: 0.85rem;
}

.climanage-holiday-calendar-table tbody td:nth-child(6) {
    text-align: left;
}

.climanage-holiday-calendar-table .holiday-type-restricted {
    color: #E65100;
    font-weight: 500;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.pending {
    background: #FFF3E0;
    color: #E65100;
}

.status-badge.approved {
    background: #E8F5E9;
    color: #2E7D32;
}

.status-badge.rejected {
    background: #FFEBEE;
    color: #C62828;
}

.climanage-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.climanage-notice-error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

/* Tablet: reduce padding, allow horizontal scroll if needed */
@media (max-width: 1024px) {
    .leave-tabs-nav {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
    }

    .leave-tab-btn {
        flex-shrink: 0 !important;
        padding: 10px 16px;
        font-size: 13px;
    }

    .holiday-calendar-table-wrap,
    .leave-table-wrap {
        max-height: 350px;
    }

    .climanage-holiday-settings .form-row .form-field {
        width: 100%;
    }

    .climanage-holiday-calendar-table th,
    .climanage-holiday-calendar-table td,
    .climanage-leave-table-styled th,
    .climanage-leave-table-styled td,
    .climanage-holiday-list-table th,
    .climanage-holiday-list-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Mobile: card-style layout (like Projects) */
@media (max-width: 768px) {
    .climanage-leave-management {
        padding-bottom: 50px; /* Space for FAB above bottom nav */
    }

    .leave-summary-cards {
        grid-template-columns: 1fr;
    }

    .leave-content-grid {
        grid-template-columns: 1fr;
    }

    .leave-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .leave-tabs-nav {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
    }

    .leave-tab-btn {
        flex-shrink: 0 !important;
        padding: 10px 14px;
        font-size: 13px;
    }

    /* Holiday Settings: form fields stack */
    .climanage-holiday-settings .form-row .form-field {
        width: 100%;
        min-width: 0;
    }

    .climanage-holiday-settings .form-row .form-field:last-child {
        width: 100%;
    }

    .holiday-settings-section {
        padding: 16px;
        margin-bottom: 20px;
    }

    /* Admin Holiday List table: card-style */
    #holiday-list-container,
    #fetched-holidays-container {
        overflow: visible;
    }

    .climanage-holiday-settings .climanage-holiday-list-table {
        display: block;
        border: none;
    }

    .climanage-holiday-settings .climanage-holiday-list-table thead {
        display: none;
    }

    .climanage-holiday-settings .climanage-holiday-list-table tbody {
        display: block;
    }

    .climanage-holiday-settings .climanage-holiday-list-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        gap: 12px 16px;
        margin-bottom: 16px;
        padding: 16px;
        border: 1px solid var(--cliM-border-color, #e0e0e0);
        border-radius: 12px;
        background: var(--background-color, #fff);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .climanage-holiday-settings .climanage-holiday-list-table tbody td {
        display: block;
        padding: 0;
        border: none;
        background: transparent !important;
    }

    .climanage-holiday-settings .climanage-holiday-list-table tbody td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--sub-color, #666);
        margin-bottom: 4px;
    }

    .climanage-holiday-settings .climanage-holiday-list-table tbody td.leave-card-primary::before {
        content: none;
    }

    .climanage-holiday-settings .climanage-holiday-list-table tbody td.leave-card-primary {
        flex: 1 1 100%;
        font-weight: 700;
        font-size: 1.05rem;
        color: var(--color, #1a1a1a);
    }

    .climanage-holiday-settings .climanage-holiday-list-table tbody td[data-label="Include"] {
        flex: 0 0 auto;
        order: -1;
    }

    .climanage-holiday-settings .climanage-holiday-list-table tbody td[data-label="Include"]::before {
        content: none;
    }

    .climanage-holiday-settings .climanage-holiday-list-table tbody td[data-label="Date"],
    .climanage-holiday-settings .climanage-holiday-list-table tbody td[data-label="Type"] {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
    }

    .climanage-holiday-settings .climanage-holiday-list-table tbody td select.form-control {
        min-width: 0;
        width: 100%;
    }

    /* User Leave page: card-style tables */
    .climanage-leave-management .holiday-calendar-table-wrap,
    .climanage-leave-management .leave-table-wrap {
        overflow: visible;
        max-height: none;
        border: none;
    }

    .climanage-leave-management .climanage-holiday-calendar-table,
    .climanage-leave-management .climanage-leave-table-styled {
        display: block;
        border: none;
    }

    .climanage-leave-management .climanage-holiday-calendar-table thead,
    .climanage-leave-management .climanage-leave-table-styled thead {
        display: none;
    }

    .climanage-leave-management .climanage-holiday-calendar-table tbody,
    .climanage-leave-management .climanage-leave-table-styled tbody {
        display: block;
    }

    .climanage-leave-management .climanage-holiday-calendar-table tbody tr,
    .climanage-leave-management .climanage-leave-table-styled tbody tr {
        display: flex;
        flex-wrap: wrap;
        gap: 12px 16px;
        margin-bottom: 16px;
        padding: 16px;
        border: 1px solid var(--cliM-border-color, #e0e0e0);
        border-radius: 12px;
        background: var(--background-color, #fff);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .climanage-leave-management .climanage-holiday-calendar-table tbody tr.restricted {
        border-left: 4px solid #FF9800;
    }

    .climanage-leave-management .climanage-holiday-calendar-table tbody td,
    .climanage-leave-management .climanage-leave-table-styled tbody td {
        display: block;
        padding: 0;
        border: none;
        background: transparent !important;
    }

    .climanage-leave-management .climanage-holiday-calendar-table tbody td[data-label]::before,
    .climanage-leave-management .climanage-leave-table-styled tbody td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-weight: 600;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--sub-color, #666);
        margin-bottom: 4px;
    }

    .climanage-leave-management .climanage-holiday-calendar-table tbody td.leave-card-primary::before,
    .climanage-leave-management .climanage-leave-table-styled tbody td.leave-card-primary::before {
        content: none;
    }

    .climanage-leave-management .climanage-holiday-calendar-table tbody td.leave-card-primary,
    .climanage-leave-management .climanage-leave-table-styled tbody td.leave-card-primary {
        flex: 1 1 100%;
        font-weight: 700;
        font-size: 1.05rem;
        color: var(--color, #1a1a1a);
    }

    /* Holiday calendar: 2-column layout (like Team Leave Overview) */
    .climanage-leave-management .climanage-holiday-calendar-table tbody td[data-label="S.No"] {
        flex: 0 0 auto;
        order: -1;
    }

    .climanage-leave-management .climanage-holiday-calendar-table tbody td[data-label="Date"],
    .climanage-leave-management .climanage-holiday-calendar-table tbody td[data-label="Day"],
    .climanage-leave-management .climanage-holiday-calendar-table tbody td[data-label="Type"],
    .climanage-leave-management .climanage-holiday-calendar-table tbody td[data-label="Your Selection"] {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
        text-align: left;
    }

    .climanage-leave-management .climanage-holiday-calendar-table tbody td {
        text-align: left;
    }

    .climanage-leave-management .climanage-leave-table-styled tbody td {
        flex: 1 1 calc(50% - 8px);
        min-width: 0;
    }

    .climanage-leave-management .climanage-leave-table-styled tbody td[data-label="Reason"],
    .climanage-leave-management .climanage-leave-table-styled tbody td[data-label="Action"] {
        flex: 1 1 100%;
    }

    .climanage-leave-management .climanage-leave-table-styled tbody td[data-label="Action"] {
        padding-top: 12px;
        margin-top: 8px;
        border-top: 1px solid var(--cliM-border-color, #e8e8e8);
    }

    .climanage-leave-management .climanage-leave-table-styled .climanage-button.small {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 14px;
    }

    /* Hide desktop Apply for Leave, show FAB */
    .climanage-leave-management .leave-content-grid .apply-leave {
        display: none;
    }

    .leave-fab {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        position: fixed;
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        right: calc(20px + env(safe-area-inset-right, 0px));
        z-index: 99;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        border: none;
        background: var(--e-global-color-accent, #8672a3);
        color: #fff;
        font-size: 24px;
        font-weight: 300;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(134, 114, 163, 0.4);
        transition: transform 0.2s, box-shadow 0.2s;
    }

    .leave-fab:hover {
        transform: scale(1.05);
        box-shadow: 0 6px 16px rgba(134, 114, 163, 0.5);
    }

    .leave-fab:active {
        transform: scale(0.98);
    }

    .leave-fab-icon {
        line-height: 1;
    }

    .leave-fab-label {
        display: none;
        font-size: 14px;
        font-weight: 500;
    }

    /* Bottom sheet */
    .leave-bottom-sheet {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1000;
        pointer-events: none;
    }

    .leave-bottom-sheet.leave-sheet-open {
        pointer-events: auto;
    }

    .leave-bottom-sheet-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        opacity: 0;
        transition: opacity 0.3s;
    }

    .leave-sheet-open .leave-bottom-sheet-backdrop {
        opacity: 1;
    }

    .leave-bottom-sheet-panel {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 85vh;
        background: var(--background-color, #fff);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
        transform: translateY(100%);
        transition: transform 0.3s ease-out;
    }

    .leave-sheet-open .leave-bottom-sheet-panel {
        transform: translateY(0);
    }

    .leave-bottom-sheet-handle {
        width: 40px;
        height: 4px;
        background: var(--cliM-border-color, #ddd);
        border-radius: 2px;
        margin: 12px auto;
    }

    .leave-bottom-sheet-content {
        padding: 0 20px 24px;
        overflow-y: auto;
        max-height: calc(85vh - 40px);
    }

    .leave-bottom-sheet-content h2 {
        margin: 0 0 20px 0;
        font-size: 1.25rem;
    }

    .leave-bottom-sheet-content .form-row {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        margin-bottom: 16px;
    }

    .leave-bottom-sheet-content .form-row .form-field {
        flex: 1 1 100%;
        min-width: 0;
    }

    .leave-bottom-sheet-content .form-row.form-row-dates .form-field {
        flex: 1 1 calc(50% - 6px);
    }

    .leave-bottom-sheet-content .form-field input,
    .leave-bottom-sheet-content .form-field select,
    .leave-bottom-sheet-content .form-field textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
        width: 100%;
        padding: 10px 12px;
        border: 1px solid var(--cliM-border-color, #ddd);
        border-radius: 6px;
    }

    .leave-bottom-sheet-content .climanage-button.primary {
        min-height: 48px;
        width: 100%;
    }

    /* Restricted holiday section: mobile-optimized */
    .climanage-leave-management .restricted-selection {
        padding: 16px;
        padding-bottom: 80px; /* Extra clearance for last items above FAB */
    }

    .climanage-leave-management .restricted-selection h2 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }

    .climanage-leave-management .restricted-selection .section-note {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }

    .climanage-leave-management .rh-selection-count {
        display: block;
        text-align: center;
        margin-bottom: 14px;
        padding: 8px 14px;
    }

    .climanage-leave-management .rh-list {
        margin-bottom: 20px;
    }

    .climanage-leave-management .rh-list li {
        margin-bottom: 12px;
    }

    .climanage-leave-management .rh-item {
        min-height: 56px;
        padding: 14px 16px;
        gap: 16px;
        border-radius: 12px;
    }

    .climanage-leave-management .rh-item input[type="checkbox"] {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        margin-top: 0;
    }

    .climanage-leave-management .rh-name {
        font-size: 0.95rem;
    }

    .climanage-leave-management .rh-date {
        font-size: 0.8rem;
    }

    .climanage-leave-management .restricted-selection .climanage-button.primary {
        width: 100%;
        min-height: 48px;
        font-size: 15px;
    }
}
