/* ============================================================
   Dashboard – Case Updates component styles
   ============================================================ */

/* ── Header ── */
.cu-header {
    background: linear-gradient(135deg, #c5a059 0%, #a8854a 100%);
}

.cu-btn-back {
    font-size: 0.85rem;
    padding: 0;
}

.cu-header-divider {
    border-inline-start: 1px solid rgba(255, 255, 255, 0.5);
    padding-inline-start: 1rem;
}

.cu-header-title {
    font-size: 1rem;
}

.cu-header-case-num {
    font-size: 0.85rem;
}

.cu-header-case-title {
    font-size: 0.8125rem;
}

.cu-badge-status {
    background: rgba(255, 255, 255, 0.25);
    font-size: 0.75rem;
}

.cu-badge-court {
    font-size: 0.75rem;
}

/* ── Toolbar ── */
.cu-filter-date {
    color: #c5a059;
}

.cu-date-input-group {
    width: 175px;
}

.cu-date-input {
    min-width: 0;
}

.cu-btn-clear {
    font-size: 0.8rem;
}

.cu-btn-print {
    color: #a8854a;
    border: 1px solid rgba(197, 160, 89, 0.4);
    background: rgba(197, 160, 89, 0.05);
    font-size: 0.8125rem;
    white-space: nowrap;
}

/* ── Timeline ── */
.cu-timeline {
    margin-inline-start: 0.25rem;
}

.cu-timeline-connector {
    width: 2px;
    background: #dee2e6;
    inset-inline-start: 22px;
    top: 54px;
    bottom: 0;
    z-index: 0;
}

.cu-cal {
    width: 48px;
    height: 69px;
    background: #fdf8f0;
    border: 1px solid #c5a059;
    flex-shrink: 0;
    z-index: 1;
    text-align: center;
    border-radius: 0.375rem;
    display: flex;
    flex-direction: column;
}

.cu-cal-month {
    background: #c5a059;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 0.3rem 0.3rem 0 0;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.cu-cal-day {
    font-size: 1.1rem;
    font-weight: 700;
    color: #a8854a;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.cu-cal-year {
    font-size: 0.6rem;
    color: #a8854a;
    opacity: 0.75;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* ── Update row ── */
.cu-update-content {
    min-width: 0;
    padding-inline-start: 0.75rem;
}

.cu-update-title {
    font-size: 0.9375rem;
}

.cu-btn-update-print {
    color: #a8854a;
    opacity: 0.75;
}

.cu-badge-update {
    font-size: 0.7rem;
}

.cu-update-desc {
    font-size: 0.875rem;
    line-height: 1.55;
    white-space: pre-line;
}

.cu-attachment-link {
    font-size: 0.8125rem;
}

/* ============================================================
   Booking component
   ============================================================ */

/* ── Flash ── */
.bk-flash {
    background: #fdf8f0;
    border-left: 3px solid #c5a059 !important;
    color: #a8854a;
}

/* ── Appointment list calendar badge ── */
.bk-cal {
    width: 48px;
    height: 69px;
    background: #fdf8f0;
    border: 1px solid #c5a059;
    flex-shrink: 0;
    border-radius: 0.375rem;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.bk-cal-month {
    background: #c5a059;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.bk-cal-day {
    font-size: 1.1rem;
    font-weight: 700;
    color: #a8854a;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.bk-cal-year {
    font-size: 0.6rem;
    color: #a8854a;
    opacity: 0.75;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
}

/* ── Appointment list items ── */
.bk-item-title {
    font-size: 0.875rem;
}

.bk-item-desc {
    font-size: 0.875rem;
}

.bk-badge {
    font-size: 0.7rem;
}

.bk-badge-upcoming {
    background: rgba(197, 160, 89, 0.18);
    color: #a8854a;
}

.bk-badge-past {
    background: #e9ecef;
    color: #6c757d;
}

/* ── Availability info box ── */
.bk-info-box {
    background: #fdf8f0;
    border: 1px solid rgba(197, 160, 89, 0.35);
    font-size: 0.8125rem;
    color: #a8854a;
}

/* ── Modal header ── */
.bk-modal-header {
    background: linear-gradient(135deg, #c5a059 0%, #a8854a 100%);
}

/* ── Time slots grid ── */
.bk-slots {
    /* Use row-gap + column-gap separately; 'gap' shorthand can be
       zeroed by Bootstrap RTL overrides in some browsers */
    row-gap: 0.5rem;
    column-gap: 0.5rem;
}

/* ── Time slot button ── */
.bk-slot {
    font-size: 0.8125rem;
    background: #fdf8f0;
    border: 1px solid rgba(197, 160, 89, 0.45);
    color: #a8854a;
}

.bk-slot.selected,
.bk-slot:focus {
    background: #c5a059;
    border-color: #c5a059;
    color: #fff;
}

.bk-slot.booked {
    background: #f5f5f5;
    border-color: #e0e0e0;
    color: #bbb;
    cursor: not-allowed;
    opacity: 0.7;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.bk-slot-booked-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #e57373;
    font-weight: 600;
}

/* ── Summary box ── */
.bk-summary {
    background: #fdf8f0;
    border: 1px solid rgba(197, 160, 89, 0.35);
    font-size: 0.8125rem;
}

.bk-summary-title {
    font-size: 0.8125rem;
    color: #a8854a;
}

.bk-summary-label {
    min-width: 90px;
    color: #a8854a;
    font-weight: 500;
}

.bk-summary-value {
    color: #6c757d;
}

/* ── Section headings ── */
.bk-section-heading {
    font-size: 0.875rem;
    color: #a8854a;
}

/* ── Form labels ── */
.bk-form-label {
    font-size: 0.875rem;
}

/* ── Validation error ── */
.bk-error {
    font-size: 0.8125rem;
}

.bk-btn-close {
    opacity: 0.9;
}

.bk-btn-close:hover {
    opacity: 1;
}

/* ============================================================
   Dashboard – Mobile Responsiveness
   ============================================================ */

/* ── Mobile sidebar toggle button ── */
.dashboard-mobile-toggle {
    background: #fdf8f0;
    border: 1px solid rgba(197, 160, 89, 0.4) !important;
    color: #a8854a;
    font-size: 0.875rem;
    cursor: pointer;
}

.dashboard-mobile-toggle[aria-expanded="true"] .dashboard-toggle-chevron {
    transform: rotate(180deg);
}

.dashboard-toggle-chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* ── Cases / modal overlay ── */
.cu-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1055;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    padding: 1rem;
}

.cu-modal-dialog {
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* ── Sidebar: hidden on mobile until toggle opens it ── */
@media (max-width: 991.98px) {
    #dashboard-sidebar {
        display: none;
    }

    #dashboard-sidebar.sidebar-open {
        display: block !important;
        position: relative;
        z-index: 200;
    }

    #dashboard-sidebar .card {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* card-body: normal block, position context for the absolute logout */
    #dashboard-sidebar .card-body {
        position: relative;
        padding: 0.5rem !important;
    }

    /* Nav: vertical column, padded-right to clear the logout button */
    #dashboard-sidebar .card-body > nav,
    #dashboard-sidebar .card-body > .nav-pills {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        padding-top: 0.35rem;
        padding-right: 5.5rem;
    }

    /* Hide the hr — logout lives in the top-right corner instead */
    #dashboard-sidebar .card-body > hr {
        display: none !important;
    }

    /* Logout button: absolute top-right inside card-body */
    #dashboard-sidebar .card-body > form {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
    }

    /* Compact logout button styling */
    #dashboard-sidebar .card-body > form button {
        white-space: nowrap;
        width: auto !important;
        padding: 0.35rem 0.6rem !important;
        font-size: 0.8rem;
        border-radius: 0.375rem;
        background: rgba(220, 53, 69, 0.07) !important;
        border: 1px solid rgba(220, 53, 69, 0.25) !important;
        gap: 0.3rem !important;
    }

    /* Nav-links fill the nav column width */
    #dashboard-sidebar .nav-link {
        width: 100%;
    }
}

/* ── Reduce top padding on mobile ── */
@media (max-width: 767.98px) {

    /* Stat cards: stack icon + text vertically and tighten padding */
    .stat-card-body {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.4rem !important;
        padding: 0.6rem !important;
    }

    .stat-card-body > .rounded-3 {
        width: 36px !important;
        height: 36px !important;
        border-radius: 0.5rem !important;
    }

    .stat-card-body > .rounded-3 svg {
        width: 17px !important;
        height: 17px !important;
    }

    .stat-card-number {
        font-size: 1.1rem !important;
        line-height: 1 !important;
    }

    .stat-card-body .small {
        font-size: 0.68rem !important;
        line-height: 1.3;
    }

    .stat-card-body .badge {
        font-size: 0.7rem !important;
    }

    /* Cases / updates table columns: trim less important on xs */
    .dashboard-cases-table th:nth-child(4),
    .dashboard-cases-table td:nth-child(4) {
        display: none;
    }

    .dashboard-updates-table th:nth-child(5),
    .dashboard-updates-table td:nth-child(5) {
        display: none;
    }

    /* Modal full screen on mobile */
    .cu-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .cu-modal-dialog {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 1rem 1rem 0 0;
        overflow: hidden;
    }

    .cu-modal-dialog .modal-content {
        border-radius: 1rem 1rem 0 0 !important;
    }

    /* Toolbar font/spacing */
    .cu-header {
        padding: 0.75rem 1rem;
    }

    .cu-header-title {
        font-size: 0.9rem;
    }

    .cu-header-case-title {
        font-size: 0.75rem;
    }

    .cu-date-input-group {
        width: 145px;
    }

    /* Timeline calendar icon: slightly smaller */
    .cu-cal,
    .bk-cal {
        width: 42px;
        height: 62px;
    }

    .cu-cal-day,
    .bk-cal-day {
        font-size: 0.95rem;
    }
}

@media (max-width: 575.98px) {

    .cu-cal,
    .bk-cal {
        width: 38px;
        height: 56px;
    }

    .cu-cal-month,
    .bk-cal-month {
        height: 18px;
        font-size: 0.55rem;
    }

    .cu-cal-day,
    .bk-cal-day {
        font-size: 0.875rem;
    }

    .cu-cal-year,
    .bk-cal-year {
        height: 14px;
        font-size: 0.55rem;
    }
}