*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Override default page-content to stick to edges */
.page-content {
    margin-top: 72px !important;
    padding: 0 !important;
    background: #ffffff;
    min-height: calc(100vh - 132px) !important;
    /* 100vh - 60px header - 72px footer */
}

.birthday-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    min-width: 0;
}

.birthday-page>* {
    width: 100%;
    min-width: 0;
}


.birthday-page .header-banner {
    background: #fff;
    padding: 15px 25px 0 25px;
    /* add top padding since margin is 0 */
    margin: 0;
    width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .birthday-page .header-banner {
        padding: 15px 15px 0 15px;
        margin: 0;
        width: 100%;
        flex-shrink: 0;
        box-sizing: border-box;
    }
}

.birthday-page .full-width-content {
    background: #fff;
    padding: 8px 25px 100px 25px;
    /* add extra bottom padding for footer */
    margin: 0;
    width: 100% !important;
    min-height: calc(100vh - 136px);
    border: none;
    border-radius: 0;
    flex-shrink: 0;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .birthday-page .full-width-content {
        padding: 10px 15px 100px 15px;
        margin: 0;
        width: 100% !important;
        box-sizing: border-box;
    }

}

/* ── Tabs ── */
.page-tabs {
    display: flex;
    gap: 24px;
    margin-top: 0px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e8eaf0;
    position: sticky;
    top: 60px;
    left: 25px;
    right: 25px;
    background: #fff;
    z-index: 98;
    padding-top: 10px;
}

.page-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.page-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.page-tab:hover:not(.active) {
    color: #1f2937;
    border-bottom-color: #d1d5db;
}

.birthday-page>* {
    width: 100%;
    min-width: 0;
}

/* ── Page Title ── */
.page-title-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 560px) {
    .page-title-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
    }
}

.page-title {
    font-size: 21px;
    font-weight: 700;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title .title-icon {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    font-size: 28px;
    flex-shrink: 0;
}



/* ── Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    min-width: 0;
    margin-bottom: 24px;
}

@media (min-width: 700px) {
    .stats-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 14px;
    }
}

.stat-card {
    background: #fff;
    border: 1px solid #e8eaf0;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-card .stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.stat-card .stat-label-new {
    font-size: 12px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.3;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
}

.stat-card .stat-sub-new {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.3;
}

/* Mobile Layout for Stat Card (Compact Grid) */
@media (max-width: 699px) {
    .stat-card {
        display: grid;
        grid-template-areas:
            "label label"
            "icon value"
            "icon sub";
        grid-template-columns: min-content 1fr;
        align-items: center;
        padding: 10px;
        gap: 0 8px;
        border-radius: 10px;
    }

    .stat-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .stat-card .stat-info {
        display: contents;
        /* Let children join the grid */
    }

    .stat-card .stat-label-new {
        grid-area: label;
        text-align: left;
        margin-bottom: 6px;
        font-size: 10px;
        line-height: 1.2;
    }

    .stat-card .stat-icon {
        grid-area: icon;
        width: 32px;
        height: 32px;
        font-size: 16px;
        border-radius: 8px;
        align-self: center;
    }

    .stat-card .stat-value {
        grid-area: value;
        text-align: right;
        font-size: 18px;
        align-self: end;
    }

    .stat-card .stat-sub-new {
        grid-area: sub;
        text-align: right;
        font-size: 9px;
        align-self: start;
        margin-top: -2px;
    }
}

.stat-card.s-red .stat-icon {
    background: #fee2e2;
    color: #dc2626;
}

.stat-card.s-red .stat-value {
    color: #dc2626;
}

.stat-card.s-blue .stat-icon {
    background: #e0e7ff;
    color: #4338ca;
}

.stat-card.s-blue .stat-value {
    color: #4338ca;
}

.stat-card.s-green .stat-icon {
    background: #dcfce7;
    color: #16a34a;
}

.stat-card.s-green .stat-value {
    color: #16a34a;
}

.stat-card.s-orange .stat-icon {
    background: #fff7ed;
    color: #ea580c;
}

.stat-card.s-orange .stat-value {
    color: #ea580c;
}

/* ── Main grid ── */
.main-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    width: 100%;
    min-width: 0;
}

@media (min-width: 1100px) {
    .main-content {
        grid-template-columns: 1fr 320px;
        gap: 20px;
    }
}

/* ── Calendar Card ── */
.calendar-card {
    background: #fff;
    border: 1px solid #e8eaf0;
    border-radius: 16px;
    padding: 16px 12px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

@media (min-width: 600px) {
    .calendar-card {
        padding: 24px;
    }
}

.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 8px;
}

.cal-nav-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cal-month-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    min-width: 130px;
    text-align: center;
}

@media (min-width: 600px) {
    .cal-month-title {
        font-size: 18px;
        min-width: 160px;
    }
}

/* Tap-friendly nav buttons (min 44px touch target) */
.cal-nav-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    font-size: 16px;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.cal-nav-btn:hover,
.cal-nav-btn:active {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}

.cal-today-btn {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.15s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.cal-today-btn:active {
    background: #f9fafb;
    color: #111827;
}

.cal-day-headers {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    margin-bottom: 3px;
    width: 100%;
}

.cal-day-header {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: #9ca3af;
    padding: 4px 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (min-width: 600px) {
    .cal-day-header {
        font-size: 11px;
        padding: 6px 2px;
    }
}

.cal-day-header.wknd {
    color: #f97316;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
}

@media (min-width: 600px) {
    .cal-grid {
        gap: 3px;
    }
}

/* ── Day Cells ── */
.day-cell {
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    min-height: 58px;
    padding: 5px 4px 4px;
    cursor: default;
    transition: background 0.12s, border-color 0.12s;
    background: #fff;
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 400px) {
    .day-cell {
        min-height: 66px;
    }
}

@media (min-width: 600px) {
    .day-cell {
        min-height: 88px;
        padding: 7px 6px 6px;
        border-radius: 10px;
    }
}

.day-cell.other-month {
    background: #fafafa;
    opacity: 0.4;
}

.day-cell.wknd-col {
    background: #fffaf7;
}

.day-cell.has-events {
    cursor: pointer;
}

.day-cell.has-events:active {
    background: #fffaf7;
    border-color: #fed7aa;
}

@media (hover: hover) {
    .day-cell.has-events:hover {
        background: #fffaf7;
        border-color: #fed7aa;
    }
}

.day-cell.today {
    border-color: #f97316 !important;
    background: #fff7ed;
}

.day-num {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 3px;
}

@media (min-width: 600px) {
    .day-num {
        font-size: 12px;
        width: 24px;
        height: 24px;
        margin-bottom: 4px;
    }
}

.day-cell:not(.other-month) .day-num {
    color: #374151;
}

.day-cell.today .day-num {
    background: #f97316;
    color: #fff;
}

/* Birthday pills */
.bday-pill {
    font-size: 9px;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 4px;
    padding: 2px 4px 2px 3px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 2px;
    font-weight: 600;
}

@media (min-width: 600px) {
    .bday-pill {
        font-size: 10px;
        padding: 2px 5px 2px 4px;
        gap: 3px;
    }
}

.bday-pill.today-bday {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

/* Leave pills */
.leave-pill {
    font-size: 9px;
    background: #fce7f3;
    /* pink-100 */
    color: #be185d;
    /* pink-700 */
    border-radius: 4px;
    padding: 2px 4px 2px 3px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 2px;
    font-weight: 600;
}

@media (min-width: 600px) {
    .leave-pill {
        font-size: 10px;
        padding: 2px 5px 2px 4px;
        gap: 3px;
    }
}

.overflow-pill {
    font-size: 9px;
    color: #9ca3af;
    padding: 1px 3px;
    font-weight: 500;
}

/* Truncate long names inside pills */
.pill-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* On very small screens: hide 2nd pill, show xs-overflow count instead */
@media (max-width: 399px) {
    .pill-second {
        display: none !important;
    }

    .pill-overflow-xs {
        display: block !important;
    }

    .pill-overflow-2 {
        display: none !important;
    }
}

/* ── Touch Popup (replaces hover tooltip on mobile) ── */
.bday-tooltip {
    position: fixed;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 16px;
    z-index: 9999;
    max-width: 280px;
    min-width: 200px;
    pointer-events: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: none;
}

/* On mobile, center tooltip at bottom */
@media (max-width: 599px) {
    .bday-tooltip {
        left: 50% !important;
        transform: translateX(-50%);
        bottom: 24px !important;
        top: auto !important;
        max-width: calc(100vw - 32px);
    }
}

.tt-date {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #f97316;
    margin-bottom: 10px;
}

.tt-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
}

.tt-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tt-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tt-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    flex: 1;
}

/* ── Event List ── */
.event-list-header {
    margin-bottom: 24px;
}

.event-list-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px 0;
}

.event-list-header p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* Tap backdrop to close tooltip on mobile */
.tooltip-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: transparent;
}

.tooltip-backdrop.visible {
    display: block;
}

/* ── Sidebar ── */
.sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* On mobile, show sidebar as 2-col grid */
@media (max-width: 1099px) {
    .sidebar-col {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
        align-items: start;
    }
}

@media (max-width: 600px) {
    .sidebar-col {
        grid-template-columns: 1fr;
    }
}

.sidebar-card {
    background: #fff;
    border: 1px solid #e8eaf0;
    border-radius: 16px;
    padding: 16px;
}

@media (min-width: 600px) {
    .sidebar-card {
        padding: 20px;
    }
}

.sidebar-card-title {
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-card-title i {
    color: #f97316;
    font-size: 14px;
}

.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.upcoming-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #f3f4f6;
    background: #fafafa;
    transition: background 0.12s;
}

.upcoming-item.is-today {
    background: #fff7ed;
    border-color: #fed7aa;
}

.up-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.up-avatar.is-today {
    background: #fff7ed;
    color: #c2410c;
}

.up-info {
    flex: 1;
    min-width: 0;
}

.up-name {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.up-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    background: #dbeafe;
    color: #1d4ed8;
    white-space: nowrap;
}

.up-badge.is-today {
    background: #fff7ed;
    color: #c2410c;
}

.no-upcoming {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    padding: 16px 0;
}

.no-upcoming i {
    font-size: 24px;
    display: block;
    margin-bottom: 6px;
    color: #d1d5db;
}

/* Monthly distribution */
.month-dist {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.month-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.month-name {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    width: 26px;
    flex-shrink: 0;
}

.month-bar-wrap {
    flex: 1;
    height: 7px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
}

.month-bar {
    height: 100%;
    background: linear-gradient(90deg, #f97316, #fb923c);
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(.4, 0, .2, 1);
}

.month-count {
    font-size: 10px;
    font-weight: 600;
    color: #374151;
    width: 18px;
    text-align: right;
    flex-shrink: 0;
}

/* Loading / Error */
.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 13px;
    gap: 10px;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #f3f4f6;
    border-top-color: #f97316;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 20px;
    gap: 8px;
    color: #ef4444;
    font-size: 13px;
    text-align: center;
}

.error-state i {
    font-size: 28px;
    color: #fca5a5;
}

.retry-btn {
    margin-top: 4px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #ef4444;
    cursor: pointer;
    transition: background 0.15s;
    min-height: 44px;
}

.retry-btn:active {
    background: #fef2f2;
}

/* ── Event List ── */
.content-header {
    margin-bottom: 24px;
}

.content-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px 0;
}

.content-header p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.custom-select-wrapper {
    position: relative;
    user-select: none;
    min-width: 150px;
}

.custom-select-trigger {
    padding: 8px 36px 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    color: #111827;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
    height: 38px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-select-trigger:hover {
    border-color: #9ca3af;
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-options {
    position: absolute;
    display: block;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.custom-select-wrapper.open .custom-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 10px 12px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s;
}

.custom-option:hover {
    background: #f3f4f6;
    color: #111827;
}

.custom-option.selected {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}



.btn-reset {
    padding: 0 16px;
    height: 38px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-reset:hover {
    background: #f9fafb;
}

.table-wrapper {
    width: 100%;
    overflow: auto;
    max-height: 60vh;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    /* Added slight rounding to match modern look */
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 700;
    color: #111827;
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.data-table td {
    padding: 16px;
    font-size: 13px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background-color: #f1f5f9;
}

.data-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.data-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.badge-ya {
    background: #dcfce7;
    color: #16a34a;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

.badge-tidak {
    background: #f3f4f6;
    color: #4b5563;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 4px;
    transition: 0.2s;
}

.action-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.action-btn.view {
    color: #3b82f6;
}

.action-btn.edit {
    color: #3b82f6;
}

.action-btn.delete {
    color: #ef4444;
}

/* ── Sidebar Right ── */
.sidebar-right {
    position: fixed;
    top: 60px;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: calc(100vh - 60px);
    background: #fff;
    z-index: 1010;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e5e7eb;
    border-top: 1px solid #e5e7eb;
}

.sidebar-right.open {
    right: 0;
}

.sidebar-right .sidebar-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.page-wrapper {
    transition: padding-right 0.3s ease, margin-right 0.3s ease;
}

@media (min-width: 992px) {
    .page-wrapper.sidebar-open {
        margin-right: 0 !important;
        padding-right: 400px !important;
        box-sizing: border-box !important;
    }
}

.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-backdrop.show {
    display: block;
    opacity: 1;
}

.sidebar-right .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-right .sidebar-header h3 {
    margin: 0;
    font-size: 18px;
    color: #111827;
    font-weight: 700;
}

.sidebar-right .sidebar-header button {
    background: none;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
}

.sidebar-right .sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.sidebar-right .sidebar-footer {
    padding: 16px 24px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
}

.btn-tutup {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.detail-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.detail-card h4 {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px 0;
}

.detail-row {
    display: flex;
    margin-bottom: 12px;
    font-size: 13px;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-label {
    width: 140px;
    color: #6b7280;
    flex-shrink: 0;
}

.detail-value {
    color: #111827;
    font-weight: 600;
    flex: 1;
}

.timeline-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
    font-size: 13px;
}

.timeline-date {
    color: #6b7280;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-title {
    font-weight: 600;
    color: #111827;
}

.timeline-desc {
    color: #6b7280;
    margin-top: 2px;
}

.badge-dibuat {
    background: #dcfce7;
    color: #16a34a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.badge-diubah {
    background: #dbeafe;
    color: #2563eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.detail-type-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

/* ── Extracted Inline Styles ── */
.page-subtitle {
    font-size: 12px;
    font-weight: 400;
    color: #6b7280;
    margin-top: 2px;
}

.header-actions-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

@media (max-width: 767px) {
    .header-actions-container {
        width: 100%;
        justify-content: space-between;
    }
}

.btn-tambah {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-tambah:hover {
    background: #1d4ed8;
}

.btn-tambah-icon {
    font-size: 16px;
}

.view-events-container {
    align-items: stretch;
    height: 100%;
    margin-top: 5px;
}

.view-events-inner {
    flex: 1;
    min-width: 0;
}

.search-container {
    position: relative;
}

.search-input {
    padding-right: 36px;
    padding-left: 12px;
    min-width: 240px;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
    pointer-events: none;
}


.th-sortable {
    cursor: pointer;
}

.error-state-full {
    grid-column: 1/-1;
}

.icon-refresh {
    margin-right: 4px;
    vertical-align: -2px;
}

.empty-table {
    text-align: center;
    padding: 32px;
    color: #6b7280;
}

.audit-name {
    font-weight: 600;
    color: #111827;
}

.audit-date {
    font-size: 11px;
    color: #6b7280;
    margin-top: 2px;
}

.audit-time {
    font-size: 11px;
    color: #6b7280;
}

.type-badge-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.type-badge-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 15px;
    flex-shrink: 0;
}

.type-badge-text {
    font-weight: 600;
    color: #374151;
}

.font-bold {
    font-weight: 600;
}

.table-date-text {
    font-weight: 600;
    color: #111827;
}

.table-day-text {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.table-desc-cell {
    max-width: 200px;
    white-space: normal;
    font-weight: 500;
}

.timeline-dot-green {
    background: #16a34a;
}

.timeline-dot-blue {
    background: #3b82f6;
}

.badge-right {
    margin-left: auto;
}

.detail-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-row-top {
    margin-top: 4px;
}

.detail-val-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-val-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-desc {
    font-size: 11.5px;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.4;
}

.detail-card-flat {
    border: none;
    padding: 0;
}

.timeline-container {
    position: relative;
    padding-left: 12px;
    margin-top: 16px;
}

.timeline-line {
    position: absolute;
    left: 16px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #e5e7eb;
}

/* ── Tabs ── */
.page-tabs {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
    padding-bottom: 0;
    margin-top: 0px;
}

.page-tab {
    background: none;
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-tab:hover {
    color: #111827;
}

.page-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.data-table thead th {
    color: #3360dd !important;
    /* Warna font biru untuk header tabel */
}

/* ------------------------
   NEW STYLES FROM CALENDER
------------------------- */



/* ── Tabs ── */
.page-tabs {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e8eaf0;
}



.event-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}



.event-table {
    width: 100%;
    border-collapse: collapse;
}



.event-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    color: #111827;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}



.event-table td {
    padding: 16px;
    font-size: 13px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}



.event-table tbody tr:hover {
    background-color: #f8fafc;
}



.event-type-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

/* Prevent background scroll when sidebar is open on mobile */
@media (max-width: 992px) {
    body.sidebar-open-mobile {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
        height: 100% !important;
    }
}


/* ------------------------
   NEW STYLES FROM CREATE/EDIT EVENT
------------------------- */


*,
*::before,
*::after {
    box-sizing: border-box;
}

.create-page,
.create-page * {
    font-family: 'Inter', sans-serif;
}

.create-page {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    background-color: #fff;
    margin-top: -25px;
    padding: 0 24px 24px 24px;
}

/* ── Left Column Card ── */
.left-content {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

/* ── Header ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.title-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #eff6ff;
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.title-text h1 {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.title-text p {
    font-size: 13px;
    color: #6b7280;
    margin: 4px 0 0 0;
}

.btn-batal {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Layout ── */
.main-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

@media (min-width: 1100px) {
    .main-content {
        grid-template-columns: 1fr 340px;
    }
}

/* ── Section Cards ── */
.section-card {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.section-card:last-child {
    border-bottom: none;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.section-title h2 {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.section-title p {
    font-size: 13px;
    color: #6b7280;
    margin: 4px 0 0 0;
}

/* ── Right Sidebar Cards ── */
.side-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.side-card.bg-light-yellow {
    background: #fffdf8;
    border-color: #fef08a;
}

.side-card.bg-light-purple {
    background: #fdfcff;
    border-color: #e9d5ff;
}

.side-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 16px;
}

/* ── Form Elements ── */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: #fff;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* select.form-control hidden rule removed to fix native selects */

.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.custom-select-trigger {
    width: 100%;
    padding: 10px 36px 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.custom-select-trigger:hover {
    border-color: #9ca3af;
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-options {
    position: absolute;
    display: block;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.custom-select-wrapper.open .custom-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 10px 12px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s;
}

.custom-option:hover {
    background: #f3f4f6;
    color: #111827;
}

.custom-option.selected {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}

/* ── Badges / Chips ── */
.date-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.date-chip button {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Buttons ── */
.btn-primary {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-outline {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-outline:hover {
    background: #f9fafb;
}

.btn-outline-primary {
    background: #eff6ff;
    border: none;
    color: #2563eb;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ── Table ── */
.staged-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.staged-table th {
    background: #f9fafb;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #4b5563;
    border-bottom: 1px solid #e5e7eb;
}

.staged-table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    color: #111827;
    vertical-align: top;
}

.badge-ya {
    background: #dcfce7;
    color: #16a34a;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-tidak {
    background: #f3f4f6;
    color: #4b5563;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* ── Radio ── */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

.radio-label input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ── Responsive Layout Classes ── */
.date-picker-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

@media (min-width: 768px) {
    .date-picker-layout {
        flex-direction: row;
    }
}

.date-picker-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

@media (min-width: 768px) {
    .date-picker-controls {
        flex-direction: row;
        align-items: center;
    }
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}

@media (min-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.action-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
}

@media (min-width: 768px) {
    .action-footer {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.action-footer-right {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

@media (min-width: 768px) {
    .action-footer-right {
        flex-direction: row;
        align-items: center;
        width: auto;
    }
}

/* ------------------------
   NEW STYLES FROM ANNOUNCEMENT CREATE
------------------------- */
/* ── Quill Editor ── */
.ql-toolbar.ql-snow {
    border: 1px solid #dde1e7;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    background: #fafafa;
    font-family: inherit;
}

.ql-container.ql-snow {
    border: 1px solid #dde1e7;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    height: auto !important;
    min-height: 150px;
}

.ql-editor {
    min-height: 150px;
    color: #1a1a2e;
    line-height: 1.6;
    height: auto !important;
    overflow-y: hidden !important;
}

.ql-editor p {
    margin: 0 !important;
    padding: 0 !important;
}

.ql-editor.ql-blank::before {
    color: #a0a0a0;
    font-style: normal;
}


/* ── Target toggle ── */
.target-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

.target-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1.5px solid #dde1e7;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: all .15s;
    font-family: inherit;
    white-space: nowrap;
}

.target-btn i {
    font-size: 15px;
}

.target-btn:hover {
    border-color: #1976d2;
    background: #f0f7ff;
    color: #1565c0;
}

.target-btn.active {
    border-color: #1976d2;
    background: #e8f4fd;
    color: #1565c0;
}

.target-btn.active i {
    color: #1565c0;
}

.unit-field {
    margin-top: 14px;
    display: none;
}

.unit-field.show {
    display: block;
}

/* ── Checkbox Pill ── */
.checkbox-pill {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-pill input[type="checkbox"] {
    display: none;
}

.checkbox-pill .pill-text {
    padding: 7px 16px;
    border: 1px solid #dde1e7;
    border-radius: 20px;
    font-size: 13px;
    color: #555;
    background: #fafafa;
    transition: all 0.2s ease-in-out;
    user-select: none;
}

.checkbox-pill:hover .pill-text {
    border-color: #1976d2;
    color: #1976d2;
    background: #f0f7ff;
}

.checkbox-pill input[type="checkbox"]:checked+.pill-text {
    background: #1976d2;
    border-color: #1976d2;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.2);
}

/* ── Upload zone ── */
.upload-zone {
    border: 1.5px dashed #c5cae9;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    transition: all .15s;
    position: relative;
}

.upload-zone:hover {
    border-color: #1976d2;
    background: #f0f7ff;
}

.upload-zone input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-zone .uz-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #e8f4fd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.upload-zone .uz-icon i {
    font-size: 20px;
    color: #1976d2;
}

.upload-zone .uz-title {
    font-size: 13px;
    font-weight: 500;
    color: #444;
    margin-bottom: 2px;
}

.upload-zone .uz-title span {
    color: #1976d2;
}

.upload-zone .uz-sub {
    font-size: 12px;
    color: #aaa;
}

/* ── File list ── */
.file-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f5f7fa;
    border-radius: 8px;
    border: 1px solid #e8eaed;
}

.file-item .fi-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: #e8f4fd;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-item .fi-icon i {
    font-size: 14px;
    color: #1976d2;
}

.file-name {
    flex: 1;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    color: #aaa;
    white-space: nowrap;
}

.file-item .remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: all .15s;
}

.file-item .remove-btn:hover {
    color: #e53935;
    background: #fdecea;
}

/* ── Toast ── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #2e7d32;
    color: #fff;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(12px);
    transition: all .25s;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
    z-index: 9999;
}

.toast.err {
    background: #c62828;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ── Spin ── */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin .7s linear infinite;
    display: inline-block;
}

/* ── Mobile Responsive ── */


/* Global override untuk menyatukan background */
.page-wrapper {
    background: #ffffff !important;
}


/* ── Mobile Responsive untuk Sidebar Kanan ── */
@media (max-width: 991px) {
    .sidebar-right {
        max-width: 100% !important;
        top: 0 !important;
        height: 100vh !important;
        z-index: 99999 !important;
        border-left: none !important;
        right: -100% !important;
    }

    .sidebar-right.open {
        right: 0 !important;
    }

    .page-wrapper.sidebar-open {
        padding-right: 0 !important;
    }
}


/* Pastikan backdrop menutupi segalanya di mobile */
@media (max-width: 991px) {
    .sidebar-backdrop {
        z-index: 99998 !important;
    }
}

/* Responsive Table Columns for Master-Detail View */
@media (max-width: 992px) {

    .hide-on-shrink,
    .hide-on-mobile {
        display: none !important;
    }
}

.page-wrapper.sidebar-open .hide-on-shrink {
    display: none !important;
}

/* ── Pagination Footer ── */
#fixedPaginationFooter {
    position: fixed !important;
    bottom: 18px !important;
    left: 240px;
    width: calc(100% - 240px);
    z-index: 998;
    background-color: #ffffff !important;
    transition: left 0.1s ease, width 0.1s ease;
    padding: 10px 25px !important;
    margin-top: 0 !important;
}

body.sidebar-folded #fixedPaginationFooter {
    left: 70px;
    width: calc(100% - 70px);
}

@media (max-width: 991px) {
    #fixedPaginationFooter {
        left: 0;
        width: 100%;
    }
}

.page-num {
    cursor: pointer;
    padding: 0 4px;
    color: #64748b;
    font-size: 13px;
    user-select: none;
}

.page-num.active {
    color: #ef4444;
    font-weight: 600;
}

.page-num:hover:not(.active) {
    color: #1e293b;
}

.pagination-footer button:hover {
    background: #f8fafc !important;
}

.pagination-footer {
    min-height: 36px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: #475569;
    margin-right: auto;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: #475569;
}

.page-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-nav .ti-chevron-left,
.page-nav .ti-chevron-right {
    cursor: pointer;
    color: #64748b;
    font-size: 14px;
}

.page-nav .ti-chevron-left:hover,
.page-nav .ti-chevron-right:hover {
    color: #1e293b;
}

.pagination-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.pagination-items-select {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    color: #475569;
    outline: none;
    background: #fff;
    cursor: pointer;
}

.pagination-jump-input {
    width: 40px;
    height: 26px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 4px;
    text-align: center;
    font-size: 13px;
    color: #475569;
    outline: none;
}

.pagination-go-btn {
    height: 26px;
    border: 1px solid #cbd5e1;
    background: #fff;
    padding: 0 10px;
    border-radius: 4px;
    cursor: pointer;
    color: #475569;
    font-size: 13px;
    outline: none;
    transition: background 0.2s;
}
/* =============================================
   PAGE CONTENT SQUEEZE/SHRINK EFFECT
   ============================================= */
.page-wrapper {
    transition: padding-right 0.32s cubic-bezier(0.4, 0, 0.2, 1) !important;
    will-change: padding-right;
}

.page-wrapper.sidebar-open {
    padding-right: 400px !important;
}

/* Responsif: Jika di mobile, tidak perlu menyusutkan konten karena sidebar memenuhi layar */
@media (max-width: 992px) {
    .page-wrapper.sidebar-open {
        padding-right: 0 !important;
    }
}

/* =============================================
   UNIVERSAL STICKY SIDEBAR FOOTER FOR MOBILE & DESKTOP
   ============================================= */
.sidebar-right {
    height: calc(100vh - 60px) !important;
    max-height: calc(100vh - 60px) !important;
}

@media (max-width: 991px) {
    .sidebar-right {
        top: 60px !important;
        height: calc(100dvh - 60px) !important;
        max-height: calc(100dvh - 60px) !important;
    }
}

.sidebar-right .sidebar-inner {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.sidebar-right .sidebar-body {
    flex: 1 !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
}

/* Maksa semua jenis footer sidebar menempel di bagian bawah secara permanen */
.sidebar-right .sidebar-footer,
.sidebar-right #sidebar-footer,
.sidebar-right #sidebar-action-footer {
    position: sticky !important;
    bottom: 0 !important;
    background: #ffffff !important;
    z-index: 100 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: auto !important;
    flex-shrink: 0 !important;
    border-top: 1px solid #e2e8f0 !important;
}

/* =============================================
   UNIVERSAL BACKDROP STYLING & POINTER EVENTS
   ============================================= */
.sidebar-backdrop.active,
.sidebar-backdrop.show {
    display: block !important;
    opacity: 1 !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 1000 !important; /* Di bawah sidebar (1010) */
    cursor: pointer;
}

/* Di Desktop: jadikan backdrop transparan agar bisa diklik tanpa menggelapkan konten sebelah kiri */
@media (min-width: 992px) {
    .sidebar-backdrop.active,
    .sidebar-backdrop.show {
        background: transparent !important;
    }
}

/* Di Mobile: tetap gunakan overlay hitam semi-transparan untuk fokus */
@media (max-width: 991px) {
    .sidebar-backdrop.active,
    .sidebar-backdrop.show {
        background: rgba(15, 23, 42, 0.45) !important;
        backdrop-filter: blur(2px);
    }
}
