/* ==========================================================================
   report.css — Booking Report & Historical Analytics Stylesheet
   Designed for Admin Executive Insights, Audits, and Historical Lookups
   ========================================================================== */

/* Main Layout */
.rep-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1.25rem 3.5rem;
    min-height: calc(100vh - 68px);
}

.rep-container {
    width: 100%;
    max-width: 1240px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: repFadeUp 0.35s ease both;
}

@keyframes repFadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header & Subtitle Enhancement */
.rep-header-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.rep-banner-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rep-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(224, 36, 64, 0.12), rgba(224, 36, 64, 0.04));
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rep-banner-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-ink);
    margin: 0;
    line-height: 1.3;
}

.rep-banner-subtitle {
    font-size: 0.875rem;
    color: var(--color-ink-muted);
    margin-top: 0.2rem;
}

.rep-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* Action Buttons */
.rep-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.18s ease;
    text-decoration: none;
    white-space: nowrap;
}

.rep-btn-primary {
    background: var(--color-primary);
    color: #ffffff;
}

.rep-btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 4px 14px var(--color-primary-glow);
}

.rep-btn-excel {
    background: #107c41;
    color: #ffffff;
}

.rep-btn-excel:hover {
    background: #0b5e31;
    box-shadow: 0 4px 14px rgba(16, 124, 65, 0.25);
}

.rep-btn-print {
    background: #1e40af;
    color: #ffffff;
}

.rep-btn-print:hover {
    background: #1e3a8a;
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.25);
}

.rep-btn-outline {
    background: #ffffff;
    border-color: var(--color-border);
    color: var(--color-ink);
}

.rep-btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Filter Card Panel */
.rep-filter-panel {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.rep-filter-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.rep-filter-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-ink);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.rep-presets {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.rep-preset-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-family: inherit;
    border-radius: 9999px;
    border: 1px solid var(--color-border);
    background: #f8fafc;
    color: var(--color-ink-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.rep-preset-btn:hover {
    background: #e2e8f0;
    color: var(--color-ink);
}

.rep-preset-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
    font-weight: 500;
}

/* Filter Controls Grid */
.rep-filter-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 0.75rem;
    align-items: end;
}

@media (max-width: 1024px) {
    .rep-filter-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .rep-filter-grid {
        grid-template-columns: 1fr;
    }
}

.rep-control-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.rep-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-ink);
}

.rep-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.rep-input-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--color-ink-muted);
    pointer-events: none;
}

.rep-input {
    width: 100%;
    height: 38px;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--color-ink);
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rep-input.has-icon {
    padding-left: 2.35rem;
}

.rep-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.rep-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
    appearance: none;
    -webkit-appearance: none;
}

/* KPI Summary Metric Cards */
.rep-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.85rem;
}

@media (max-width: 1100px) {
    .rep-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .rep-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.rep-stat-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.rep-stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rep-stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rep-stat-card.stat-total .rep-stat-icon {
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

.rep-stat-card.stat-approved .rep-stat-icon {
    background: rgba(5, 150, 105, 0.12);
    color: #059669;
}

.rep-stat-card.stat-pending .rep-stat-icon {
    background: rgba(217, 119, 6, 0.12);
    color: #d97706;
}

.rep-stat-card.stat-rejected .rep-stat-icon {
    background: rgba(225, 29, 72, 0.12);
    color: #e11d48;
}

.rep-stat-card.stat-toproom .rep-stat-icon {
    background: rgba(147, 51, 234, 0.12);
    color: #9333ea;
}

.rep-stat-card.stat-hours .rep-stat-icon {
    background: rgba(2, 132, 199, 0.12);
    color: #0284c7;
}

.rep-stat-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--color-ink-muted);
}

.rep-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-ink);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.rep-stat-desc {
    font-size: 0.75rem;
    color: var(--color-ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Visual Analytics Breakdown Grid */
.rep-charts-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 1rem;
}

@media (max-width: 900px) {
    .rep-charts-grid {
        grid-template-columns: 1fr;
    }
}

.rep-chart-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.4rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.rep-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.65rem;
}

.rep-chart-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-ink);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.rep-chart-badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-ink-muted);
    background: #f1f5f9;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
}

/* Room Bar Distribution List */
.rep-room-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rep-room-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rep-room-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.82rem;
}

.rep-room-name {
    font-weight: 600;
    color: var(--color-ink);
}

.rep-room-stat {
    font-size: 0.78rem;
    color: var(--color-ink-muted);
}

.rep-room-bar-bg {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: 9999px;
    overflow: hidden;
}

.rep-room-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #e02440, #f43f5e);
    border-radius: 9999px;
    transition: width 0.4s ease;
}

/* Status Breakdown Bars */
.rep-status-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    height: 100%;
}

.rep-status-stacked-bar {
    width: 100%;
    height: 20px;
    background: #f1f5f9;
    border-radius: 9999px;
    display: flex;
    overflow: hidden;
}

.rep-stacked-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.rep-stacked-segment.approved {
    background: #059669;
}

.rep-stacked-segment.pending {
    background: #d97706;
}

.rep-stacked-segment.rejected {
    background: #e11d48;
}

.rep-status-legend {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.rep-legend-item {
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.75rem;
    text-align: center;
}

.rep-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.rep-legend-dot.approved { background: #059669; }
.rep-legend-dot.pending { background: #d97706; }
.rep-legend-dot.rejected { background: #e11d48; }

.rep-legend-count {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-ink);
    margin-top: 0.2rem;
}

/* Table Card Panel */
.rep-table-panel {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.rep-table-header {
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.rep-table-info {
    font-size: 0.9rem;
    color: var(--color-ink);
    font-weight: 500;
}

.rep-table-info strong {
    color: var(--color-primary);
}

.rep-table-tools {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Responsive Table Container */
.rep-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rep-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
    white-space: nowrap;
}

.rep-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    user-select: none;
}

.rep-table th.sortable {
    cursor: pointer;
}

.rep-table th.sortable:hover {
    background: #f1f5f9;
    color: var(--color-ink);
}

.rep-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--color-ink);
    vertical-align: middle;
}

.rep-table tbody tr {
    transition: background-color 0.12s ease;
}

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

/* Status Pill Badges */
.rep-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    letter-spacing: 0.01em;
}

.rep-badge.approved {
    background: rgba(5, 150, 105, 0.1);
    color: #047857;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.rep-badge.pending {
    background: rgba(217, 119, 6, 0.1);
    color: #b45309;
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.rep-badge.rejected {
    background: rgba(225, 29, 72, 0.1);
    color: #be123c;
    border: 1px solid rgba(225, 29, 72, 0.2);
}

/* Action button in table */
.rep-table-action-btn {
    background: #ffffff;
    border: 1px solid var(--color-border);
    color: var(--color-ink);
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s ease;
}

.rep-table-action-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--color-primary);
}

/* Pagination Footer */
.rep-pagination {
    padding: 0.85rem 1.4rem;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: var(--color-ink-muted);
}

.rep-page-controls {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.rep-page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: #ffffff;
    color: var(--color-ink);
    cursor: pointer;
    transition: all 0.15s ease;
}

.rep-page-btn:hover:not(:disabled) {
    background: #f1f5f9;
}

.rep-page-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

.rep-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Loading Skeleton & Empty State */
.rep-empty {
    padding: 3.5rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-ink-muted);
}

.rep-empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.rep-skeleton-row td {
    padding: 1rem;
}

.rep-skeleton-bar {
    height: 14px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: repSkeleton 1.4s infinite;
}

@keyframes repSkeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Detail Modal */
.rep-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.rep-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.rep-modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 560px;
    overflow: hidden;
    transform: translateY(15px);
    transition: transform 0.2s ease;
}

.rep-modal-backdrop.active .rep-modal-card {
    transform: translateY(0);
}

.rep-modal-head {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rep-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-ink);
    margin: 0;
}

.rep-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-ink-muted);
    padding: 0.35rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rep-modal-close:hover {
    background: #f1f5f9;
    color: var(--color-ink);
}

.rep-modal-body {
    padding: 1.4rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    max-height: 70vh;
    overflow-y: auto;
}

.rep-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}

.rep-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.rep-detail-item.full-width {
    grid-column: 1 / -1;
}

.rep-detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rep-detail-val {
    font-size: 0.92rem;
    color: var(--color-ink);
    font-weight: 500;
}

.rep-detail-note {
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.9rem;
    font-size: 0.88rem;
    color: var(--color-ink);
    line-height: 1.5;
}

/* Equipment Display in Modal */
.rep-equipment-box {
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.rep-equipment-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.rep-equipment-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.3rem 0.65rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.rep-equipment-tag svg {
    color: #059669;
}

.rep-equipment-note {
    font-size: 0.85rem;
    color: var(--color-ink);
    background: #fefce8;
    border: 1px solid #fef08a;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    line-height: 1.5;
}

.rep-equipment-note strong {
    color: #854d0e;
    margin-right: 4px;
}

/* ==========================================================================
   Print-Specific Stylesheet (@media print)
   ========================================================================== */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt;
    }

    /* Hide Navigation, Filters, Buttons, Modal Backdrops */
    .dash-header,
    .rep-banner-actions,
    .rep-filter-panel,
    .rep-table-tools,
    .rep-pagination,
    .rep-table th:last-child,
    .rep-table td:last-child,
    .rep-modal-backdrop,
    #adminProfileText,
    #logoutBtn {
        display: none !important;
    }

    .rep-main {
        padding: 0 !important;
        min-height: auto !important;
    }

    .rep-container {
        max-width: 100% !important;
        gap: 1.5rem !important;
    }

    .rep-header-banner {
        border: none !important;
        box-shadow: none !important;
        padding: 0 0 1rem 0 !important;
        border-bottom: 2px solid #000000 !important;
        border-radius: 0 !important;
    }

    .rep-banner-icon {
        display: none !important;
    }

    .rep-print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .rep-print-header h2 {
        font-size: 16pt;
        margin-bottom: 0.2rem;
    }

    .rep-print-header p {
        font-size: 11pt;
        color: #333;
    }

    /* Stats Grid Print Layout */
    .rep-stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.5rem !important;
    }

    .rep-stat-card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
        border-radius: 4px !important;
        padding: 0.5rem !important;
    }

    .rep-stat-value {
        font-size: 1.3rem !important;
    }

    /* Print Table */
    .rep-table-panel {
        border: none !important;
        box-shadow: none !important;
    }

    .rep-table {
        width: 100% !important;
        border: 1px solid #000000 !important;
        border-collapse: collapse !important;
    }

    .rep-table th,
    .rep-table td {
        border: 1px solid #333333 !important;
        padding: 6px 8px !important;
        font-size: 9pt !important;
        white-space: normal !important;
    }

    .rep-table th {
        background: #f0f0f0 !important;
    }

    /* Signature Box for Official Report */
    .rep-print-signatures {
        display: flex !important;
        justify-content: space-around;
        margin-top: 3rem;
        page-break-inside: avoid;
    }

    .rep-sign-box {
        text-align: center;
        width: 250px;
    }

    .rep-sign-line {
        border-bottom: 1px dashed #000000;
        height: 40px;
        margin-bottom: 0.5rem;
    }
}
