/* Restaurant Reservation System Admin Styles */

.reservation-system {
    padding: 20px;
    background: #f5f5f5;
}

.reservation-header {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-controls label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

#reservation-date {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.reservation-stats {
    display: flex;
    gap: 20px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-box label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.stat-value.highlight {
    background: #ffeb3b;
    padding: 5px 15px;
    border-radius: 4px;
}

/* Color coding for guest capacity */
.stat-value.status-green {
    background: #d4edda;
    color: #155724;
}

.stat-value.status-yellow {
    background: #fff3cd;
    color: #856404;
}

.stat-value.status-red {
    background: #f8d7da;
    color: #721c24;
}

/* Capacity warning banner */
.capacity-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #856404;
}

/* Status badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.confirmed {
    background: #d4edda;
    color: #155724;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.cancelled {
    background: #f8d7da;
    color: #721c24;
    text-decoration: line-through;
}

.cancelled-badge {
    display: block;
    font-size: 11px;
    color: #721c24;
    background: #f8d7da;
    padding: 2px 8px;
    border-radius: 3px;
    margin-top: 5px;
}

.pending-badge {
    display: block;
    font-size: 11px;
    color: #856404;
    background: #fff3cd;
    padding: 2px 8px;
    border-radius: 3px;
    margin-top: 5px;
}

/* Row highlighting for pending */
.reservation-table tbody tr.status-pending {
    background: #fffbf0;
}

.reservation-table tbody tr.status-pending:hover {
    background: #fff8e1;
}

.reservation-table tbody tr.status-cancelled {
    background: #fff5f5;
    opacity: 0.7;
}

.reservation-table tbody tr.status-cancelled:hover {
    background: #ffefef;
}

/* Confirm button */
.confirm-btn {
    background: #46b450;
    color: white;
    border: none;
    margin-right: 5px;
}

.confirm-btn:hover {
    background: #3a9c42;
    color: white;
}

.reservation-filters {
    background: white;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

#search-reservations {
    width: 260px;
    padding: 9px 14px 9px 36px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 12px center;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #374151;
}

#search-reservations:focus {
    outline: none;
    border-color: #2271b1;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(34,113,177,0.1);
}

#search-reservations::placeholder { color: #9ca3af; }

.filter-left {
    flex: 0 0 auto;
}

.filter-right {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
}

.filter-btn {
    padding: 7px 16px;
    border: none;
    background: transparent;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    background: white;
    color: #374151;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-btn.active {
    background: #2271b1;
    color: white;
    box-shadow: 0 2px 6px rgba(34,113,177,0.3);
}

.filter-btn.active:hover {
    background: #135e96;
    color: white;
    box-shadow: 0 2px 8px rgba(34,113,177,0.4);
}


/* Scroll container so the table can overflow horizontally on narrow screens */
.reservation-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.reservation-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    table-layout: auto;
    width: 100%;
}

.reservation-table thead th {
    background: #f9f9f9;
    font-weight: 600;
    padding: 12px;
    border-bottom: 2px solid #ddd;
    text-align: center !important;
    font-size: 15px;
    color: #333;
}

.reservation-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
    text-align: center !important;
}
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 200px;

.reservation-table tbody tr:hover {
    background: #f9f9f9;
}

.name-cell strong {
    color: #2271b1;
    font-weight: 600;
}

.note-indicator {
    color: #ff0000;
    font-size: 16px;
}

.source-badge {
    background: #2271b1;
    color: white;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.edit-btn {
    background: #2271b1;
    color: white;
    border: none;
    margin-right: 5px;
}

.edit-btn:hover {
    background: #135e96;
    color: white;
}

.delete-btn {
    background: #dc3232;
    color: white;
    border: none;
}

.delete-btn:hover {
    background: #a00;
    color: white;
}

.send-email-btn {
    background: #00a0d2;
    color: white;
    border: none;
    margin-right: 5px;
}

.send-email-btn:hover {
    background: #0087be;
    color: white;
}

.send-email-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

.cancel-res-btn {
    background: #d63638;
    color: white;
    border: none;
    margin-right: 5px;
}

.cancel-res-btn:hover {
    background: #c92d2f;
    color: white;
}

/* Modal Styles */
.reservation-modal {
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 600px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close-modal:hover {
    color: #000;
}

.close-email-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close-email-modal:hover {
    color: #000;
}

#email-recipient-display {
    color: #0073aa;
}

#modal-title {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-row input[type="text"],
.form-row input[type="tel"],
.form-row input[type="date"],
.form-row input[type="time"],
.form-row input[type="number"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-row textarea {
    resize: vertical;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.form-actions .button-primary {
    background: #2271b1;
    border-color: #2271b1;
    padding: 8px 20px;
}

.form-actions .button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

.form-actions .cancel-btn {
    padding: 8px 20px;
}

.form-actions .sc-action-btn {
    padding: 9px 22px;
}

.form-actions .sc-modal-cancel-btn {
    padding: 9px 22px;
}

/* Responsive */
@media (max-width: 1200px) {
    .reservation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .reservation-stats {
        width: 100%;
        justify-content: space-around;
    }
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }

    /* Keep table as a normal table — just scroll it horizontally */
    .reservation-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        border-radius: 8px;
    }

    .reservation-table {
        font-size: 12px;
        min-width: 800px; /* forces scroll rather than squishing */
        white-space: nowrap;
    }

    .reservation-table thead th,
    .reservation-table tbody td {
        padding: 8px;
        white-space: nowrap;
    }
}

/* Loading animation */
@keyframes rotation {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(359deg);
    }
}
/* Active/Honored button and text */
.active-btn {
    background: #2271b1;
    color: white;
    border: none;
    padding: 4px 12px;
    font-weight: 600;
    border-radius: 3px;
}

.active-btn:hover {
    background: #135e96;
    color: white;
}

.honored-text {
    color: #155724;
    font-weight: 600;
}

/* Green highlight for honored reservations */
.reservation-table tbody tr.reservation-honored {
    background: #d4edda !important;
}

.reservation-table tbody tr.reservation-honored:hover {
    background: #c3e6cb !important;
}

/* No Show text and highlight */
.no-show-text {
    color: #856404;
    font-weight: 600;
}

/* Yellow highlight for no-show reservations */
.reservation-table tbody tr.reservation-no-show {
    background: #fff3cd !important;
}

.reservation-table tbody tr.reservation-no-show:hover {
    background: #ffe8a1 !important;
}

/* Red highlight for cancelled reservations */
.reservation-table tbody tr.status-cancelled {
    background: #f8d7da !important;
    opacity: 1;
}

.reservation-table tbody tr.status-cancelled:hover {
    background: #f5c6cb !important;
}

/* Action dropdown styling with cogwheel icon */
.action-cell {
    text-align: center;
}

.action-dropdown-wrapper {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 30px;
}

.action-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: #2271b1;
    pointer-events: none;
    transition: all 0.3s ease;
}

.action-dropdown-wrapper:hover .action-icon {
    color: #135e96;
    transform: translate(-50%, -50%) rotate(90deg);
}

.action-dropdown {
    position: relative;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0;
    color: transparent;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.action-dropdown:focus {
    outline: none;
    width: 180px;
    height: auto;
    background: white;
    border: 1px solid #2271b1;
    border-radius: 4px;
    padding: 8px;
    font-size: 14px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
}

.action-dropdown:focus + .action-icon {
    display: none;
}

.action-dropdown option {
    background: white;
    color: #333;
    padding: 8px;
    font-size: 14px;
}

.action-dropdown option[value=""] {
    font-weight: 600;
    color: #666;
}

/* No Show badge */
.no-show-badge {
    display: block;
    font-size: 11px;
    color: #856404;
    background: #fff3cd;
    padding: 2px 8px;
    border-radius: 3px;
    margin-top: 5px;
}

/* No Show status badge */
.status-badge.no-show {
    background: #fff3cd;
    color: #856404;
}

/* Cancelled text in honored column */
.cancelled-text {
    color: #721c24;
    font-weight: 600;
}

/* Admin Form Grid Layout */
.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.admin-form-grid .form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.admin-form-grid .form-row.full-width {
    grid-column: 1 / -1;
}

.admin-form-grid .form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.admin-form-grid .form-row input[type="text"],
.admin-form-grid .form-row input[type="tel"],
.admin-form-grid .form-row input[type="email"],
.admin-form-grid .form-row input[type="date"],
.admin-form-grid .form-row input[type="number"],
.admin-form-grid .form-row select,
.admin-form-grid .form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
    background: white;
    box-sizing: border-box;
}

.admin-form-grid .form-row input:focus,
.admin-form-grid .form-row select:focus,
.admin-form-grid .form-row textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.admin-form-grid .form-row input::placeholder,
.admin-form-grid .form-row textarea::placeholder {
    color: #999;
}

.admin-form-grid .form-row textarea {
    resize: vertical;
    min-height: 60px;
}

/* Modal content wider for grid */
.modal-content {
    max-width: 800px;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-form-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-form-grid .form-row.full-width {
        grid-column: 1;
    }
}

/* Bill Amount Input */
.bill-amount-cell {
    text-align: center;
}

.bill-amount-input {
    width: 80px;
    text-align: right;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.3s ease;
}

.bill-amount-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

.bill-amount-input::placeholder {
    color: #999;
}

/* =============================================
   MOBILE & TABLET RESPONSIVE — ADMIN SHORTCODE
   ============================================= */

@media (max-width: 1024px) {
    .reservation-system-shortcode .reservation-header {
        flex-direction: column;
        gap: 15px;
    }

    .reservation-system-shortcode .reservation-stats {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .reservation-system-shortcode .stat-box {
        background: #f9f9f9;
        border-radius: 8px;
        padding: 10px;
        align-items: center;
        text-align: center;
    }

    .report-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 768px) {

    /* === PAGE PADDING === */
    .reservation-system-shortcode {
        padding: 10px 5px !important;
    }

    /* === TITLE ROW === */
    .reservation-system-shortcode > div:first-child {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }

    .reservation-system-shortcode h1 {
        font-size: 20px !important;
    }

    /* === HEADER: date + add button === */
    .reservation-system-shortcode .reservation-header {
        padding: 15px;
        gap: 15px;
    }

    .reservation-system-shortcode .header-controls {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .reservation-system-shortcode .header-controls label {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        font-size: 13px;
    }

    #reservation-date {
        width: 100%;
        font-size: 16px; /* prevent iOS zoom */
        padding: 10px;
    }

    .reservation-system-shortcode #add-reservation-btn {
        width: 100%;
        text-align: center;
        padding: 10px;
        font-size: 15px;
    }

    /* === STATS === */
    .reservation-system-shortcode .reservation-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .reservation-system-shortcode .stat-box {
        background: #f0f4f8;
        border-radius: 10px;
        padding: 12px 8px;
    }

    .stat-value {
        font-size: 20px !important;
    }

    .stat-box label {
        font-size: 11px;
        text-align: center;
    }

    /* === REPORTS TOGGLE === */
    .reports-section {
        margin-bottom: 15px;
    }

    .reports-toggle {
        width: 100%;
        text-align: left;
        padding: 10px 15px;
        font-size: 14px;
    }

    .reports-grid {
        grid-template-columns: 1fr !important;
    }

    .report-card {
        padding: 15px !important;
    }

    .report-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .report-controls input[type="date"],
    .report-controls select,
    .report-controls button {
        width: 100%;
        font-size: 16px; /* prevent iOS zoom */
        padding: 10px;
        box-sizing: border-box;
    }

    .export-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }

    .export-buttons .button {
        flex: 1 1 calc(50% - 4px);
        text-align: center;
        font-size: 13px;
    }

    /* === FILTERS === */
    .reservation-filters {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
        padding: 12px;
    }

    .filter-left {
        width: 100%;
    }

    #search-reservations {
        width: 100% !important;
        font-size: 16px; /* prevent iOS zoom */
        padding: 10px;
        box-sizing: border-box;
    }

    .filter-right {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .filter-btn {
        text-align: center;
        padding: 8px 4px;
        font-size: 12px;
    }

    /* === TABLE — HORIZONTAL SCROLL ON MOBILE === */
    .reservation-table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        margin: 10px 0;
        width: 100%;
        border-radius: 8px;
    }

    /* Keep the table as a normal table — just let it scroll horizontally */
    .reservation-system-shortcode .reservation-table {
        min-width: 800px;
        width: 100%;
        border-collapse: collapse;
    }

    .reservation-system-shortcode .reservation-table thead th,
    .reservation-system-shortcode .reservation-table tbody td {
        padding: 8px 10px;
        font-size: 12px;
        white-space: nowrap;
    }

    /* Row status colour accents */
    .reservation-system-shortcode .reservation-table tbody tr.status-pending {
        border-left: 4px solid #ffc107 !important;
    }

    .reservation-system-shortcode .reservation-table tbody tr.status-cancelled {
        border-left: 4px solid #dc3232 !important;
        opacity: 0.85;
    }

    .reservation-system-shortcode .reservation-table tbody tr.reservation-honored {
        border-left: 4px solid #46b450 !important;
    }

    .reservation-system-shortcode .reservation-table tbody tr.reservation-no-show {
        border-left: 4px solid #f0ad4e !important;
    }

    /* === MODAL === */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 5% auto !important;
        padding: 20px 15px !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    .admin-form-grid {
        grid-template-columns: 1fr !important;
    }

    .admin-form-grid .form-row.full-width {
        grid-column: 1 !important;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .button {
        width: 100%;
        text-align: center;
        padding: 10px;
    }
}

/* Extra small — phone portrait under 480px */
@media (max-width: 480px) {
    .reservation-system-shortcode .reservation-stats {
        grid-template-columns: 1fr 1fr;
    }

    .reservation-system-shortcode .reservation-table thead th,
    .reservation-system-shortcode .reservation-table tbody td {
        font-size: 11px;
        padding: 6px 8px;
    }

    .filter-right {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =============================================
   MODERN REPORT STYLES
   ============================================= */

/* Report results container */
.report-results { margin-top: 16px; }

/* Empty state */
.rpt-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #9ca3af;
    gap: 10px;
}
.rpt-empty .dashicons { font-size: 36px; width: 36px; height: 36px; }
.rpt-empty p { margin: 0; font-size: 14px; }

/* Header */
.rpt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f0f0f0;
}
.rpt-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.3px;
}
.rpt-period {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    flex-wrap: wrap;
}
.rpt-period .dashicons { font-size: 14px; width: 14px; height: 14px; color: #9ca3af; }

.rpt-filter-tag {
    background: #eff6ff;
    color: #2271b1;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.rpt-count-tag {
    background: #f3f4f6;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* KPI cards row */
.rpt-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.rpt-kpi {
    background: #f8fafc;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    padding: 16px 14px;
    text-align: center;
    transition: box-shadow 0.2s;
}
.rpt-kpi:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.rpt-kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: #1f2937;
    line-height: 1;
    margin-bottom: 4px;
}
.rpt-kpi-label {
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.rpt-kpi-pct {
    font-size: 13px;
    font-weight: 700;
    margin-top: 4px;
}

/* KPI colour variants */
.rpt-kpi--green { border-top: 3px solid #46b450; }
.rpt-kpi--green .rpt-kpi-value { color: #46b450; }
.rpt-kpi--green .rpt-kpi-pct  { color: #46b450; }
.rpt-kpi--blue  { border-top: 3px solid #2271b1; }
.rpt-kpi--blue  .rpt-kpi-value { color: #2271b1; }
.rpt-kpi--blue  .rpt-kpi-pct  { color: #2271b1; }
.rpt-kpi--yellow{ border-top: 3px solid #f0ad4e; }
.rpt-kpi--yellow .rpt-kpi-value { color: #d97706; }
.rpt-kpi--yellow .rpt-kpi-pct  { color: #d97706; }
.rpt-kpi--red   { border-top: 3px solid #dc3232; }
.rpt-kpi--red   .rpt-kpi-value { color: #dc3232; }
.rpt-kpi--red   .rpt-kpi-pct  { color: #dc3232; }

/* Stacked breakdown bar (status report) */
.rpt-breakdown-bar {
    display: flex;
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
    background: #f3f4f6;
}
.rpt-seg { height: 100%; transition: opacity 0.2s; }
.rpt-seg:hover { opacity: 0.75; cursor: pointer; }
.rpt-seg--green  { background: #46b450; }
.rpt-seg--blue   { background: #2271b1; }
.rpt-seg--yellow { background: #f0ad4e; }
.rpt-seg--red    { background: #dc3232; }

.rpt-breakdown-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.rpt-breakdown-legend span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #6b7280;
}
.rpt-dot-sm {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.rpt-dot-sm--green  { background: #46b450; }
.rpt-dot-sm--blue   { background: #2271b1; }
.rpt-dot-sm--yellow { background: #f0ad4e; }
.rpt-dot-sm--red    { background: #dc3232; }

/* Report table */
.rpt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 4px;
}
.rpt-table thead th {
    background: #f8fafc;
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e8ecf0;
}
.rpt-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}
.rpt-table tbody tr:hover { background: #f8fafc; }
.rpt-table tbody td {
    padding: 11px 14px;
    color: #374151;
    vertical-align: middle;
}
.rpt-total-row td {
    padding: 12px 14px;
    background: #f0f4f8 !important;
    border-top: 2px solid #e8ecf0;
    font-size: 13px;
    color: #1f2937;
}

/* Inline dot for booking type colours */
.rpt-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

/* Large bold number */
.rpt-num {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

/* Progress bar inside table cells */
.rpt-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}
.rpt-bar-wrap span { font-size: 12px; color: #6b7280; white-space: nowrap; }
.rpt-bar {
    height: 6px;
    border-radius: 3px;
    flex-shrink: 0;
    background: #2271b1;
    transition: width 0.4s ease;
    min-width: 2px;
}
.rpt-bar--green  { background: #46b450; }
.rpt-bar--blue   { background: #2271b1; }
.rpt-bar--yellow { background: #f0ad4e; }
.rpt-bar--red    { background: #dc3232; }

/* Status / action badges */
.rpt-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.rpt-badge--green  { background: #d4edda; color: #155724; }
.rpt-badge--blue   { background: #cce5ff; color: #004085; }
.rpt-badge--yellow { background: #fff3cd; color: #856404; }
.rpt-badge--red    { background: #f8d7da; color: #721c24; }
.rpt-badge--purple { background: #e8d5f5; color: #6f42c1; }
.rpt-badge--gray   { background: #f3f4f6; color: #6b7280; }

/* Activity log specific */
.rpt-datetime {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}
.rpt-user {
    font-size: 12px;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    color: #4b5563;
    font-weight: 600;
}

/* Export buttons */
.export-buttons {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.export-buttons .button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    transition: all 0.15s;
}
.export-buttons .button:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.export-buttons .button .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    color: #6b7280;
}

/* Report card container */
.report-card {
    background: white;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.report-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 7px;
}
.report-card h3 .dashicons { color: #2271b1; }

/* Responsive */
@media (max-width: 768px) {
    .rpt-kpi-row { grid-template-columns: repeat(2, 1fr); }
    .rpt-header { flex-direction: column; align-items: flex-start; }
    .rpt-table thead th, .rpt-table tbody td { padding: 8px 10px; }
    .rpt-bar-wrap { min-width: 80px; }
}
@media (max-width: 480px) {
    .rpt-kpi-row { grid-template-columns: 1fr 1fr; }
}

/* =============================================
   MODERN REPORTS SECTION
   ============================================= */

/* ---- Toggle Button ---- */
.reports-section {
    margin-bottom: 20px;
}

.reports-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    text-align: left;
    appearance: none;
    -webkit-appearance: none;
}

.reports-toggle:hover {
    background: #f8fafc;
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba(34,113,177,0.12);
}

.reports-toggle.active {
    border-color: #2271b1;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
    background: #f0f6ff;
}

.reports-toggle-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.reports-toggle-icon-wrap {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #2271b1, #135e96);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(34,113,177,0.3);
}

.reports-toggle-icon-wrap .dashicons {
    color: white;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.reports-toggle-label {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    display: block;
    line-height: 1.2;
}

.reports-toggle-sub {
    font-size: 12px;
    color: #9ca3af;
    display: block;
    margin-top: 2px;
    font-weight: 400;
}

.reports-toggle-chevron {
    color: #9ca3af;
    font-size: 18px;
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.reports-toggle.active .reports-toggle-chevron {
    transform: rotate(180deg);
    color: #2271b1;
}

/* ---- Reports Content Wrapper ---- */
.reports-content {
    background: #f8fafc;
    border: 1px solid #2271b1;
    border-top: none;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    padding: 20px;
}

/* ---- Reports Grid ---- */
.reports-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 0;
}

/* ---- Report Card ---- */
.report-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.report-card:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

.report-card--full {
    grid-column: 1 / -1;
}

/* ---- Card Header ---- */
.report-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.report-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.report-card-icon .dashicons {
    font-size: 17px;
    width: 17px;
    height: 17px;
}

.report-card-icon--blue   { background: #eff6ff; }
.report-card-icon--blue .dashicons   { color: #2271b1; }
.report-card-icon--green  { background: #f0fdf4; }
.report-card-icon--green .dashicons  { color: #46b450; }
.report-card-icon--purple { background: #faf5ff; }
.report-card-icon--purple .dashicons { color: #7c3aed; }

.report-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.report-card-desc {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

/* ---- Report Controls ---- */
.report-controls {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.report-controls--activity {
    align-items: flex-end;
}

.date-range {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.date-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-field label {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.date-field input[type="date"] {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    background: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.date-field input[type="date"]:focus {
    outline: none;
    border-color: #2271b1;
    background: white;
    box-shadow: 0 0 0 3px rgba(34,113,177,0.1);
}

.date-sep {
    font-size: 14px;
    color: #d1d5db;
    padding-bottom: 8px;
    flex-shrink: 0;
}

.rpt-select {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    background: #f9fafb;
    cursor: pointer;
    transition: border-color 0.2s;
    height: 36px;
}

.rpt-select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34,113,177,0.1);
}

/* ---- Generate Button ---- */
.rpt-generate-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #2271b1, #135e96);
    color: white !important;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(34,113,177,0.25);
    white-space: nowrap;
    height: 36px;
}

.rpt-generate-btn:hover {
    background: linear-gradient(135deg, #135e96, #0d4a7a);
    box-shadow: 0 3px 8px rgba(34,113,177,0.35);
    transform: translateY(-1px);
    color: white !important;
}

.rpt-generate-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .reports-grid {
        grid-template-columns: 1fr;
    }
    .report-card--full {
        grid-column: 1;
    }
    .report-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .date-range {
        flex-direction: column;
        align-items: stretch;
    }
    .date-sep { display: none; }
    .date-field input[type="date"],
    .rpt-select,
    .rpt-generate-btn {
        width: 100%;
        font-size: 16px;
    }
    .reports-toggle {
        padding: 12px 15px;
    }
    .reports-toggle-sub { display: none; }
}

/* =============================================
   SHORTCODE ACTION BUTTONS (Add Reservation / Add Exception)
   ============================================= */

.sc-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: linear-gradient(135deg, #2271b1, #135e96);
    color: white !important;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(34,113,177,0.25);
    text-decoration: none;
}

.sc-action-btn:hover {
    background: linear-gradient(135deg, #135e96, #0d4a7a);
    box-shadow: 0 3px 10px rgba(34,113,177,0.35);
    transform: translateY(-1px);
    color: white !important;
}

.sc-action-btn .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
}

/* Fix mobile filter bar for shortcode */
@media (max-width: 768px) {
    .reservation-filters {
        padding: 10px 12px;
        gap: 10px;
    }
    #search-reservations {
        width: 100% !important;
        font-size: 16px;
        box-sizing: border-box;
    }
    .filter-right {
        width: 100%;
        justify-content: stretch;
    }
    .filter-btn {
        flex: 1;
        text-align: center;
        padding: 8px 6px;
        font-size: 12px;
    }
    .sc-action-btn {
        width: 100%;
        justify-content: center;
        padding: 11px 18px;
        font-size: 14px;
    }
}

/* Modal cancel button */
.sc-modal-cancel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    background: white;
    color: #374151 !important;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sc-modal-cancel-btn:hover {
    background: #f8fafc;
    border-color: #9ca3af;
    color: #1f2937 !important;
}

/* =============================================
   SORTABLE COLUMN HEADERS
   ============================================= */

.reservation-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 22px !important;
    transition: background 0.15s;
}

.reservation-table th.sortable:hover {
    background: #f0f4f8;
}

.reservation-table th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #9ca3af;
    opacity: 0.7;
}

.reservation-table th.sort-asc::after {
    content: '↑';
    color: #2271b1;
    opacity: 1;
}

.reservation-table th.sort-desc::after {
    content: '↓';
    color: #2271b1;
    opacity: 1;
}

.reservation-table th.sort-asc,
.reservation-table th.sort-desc {
    background: #eff6ff !important;
    color: #2271b1;
}

/* Force center alignment — overrides WordPress wp-list-table defaults */
table.reservation-table th,
table.reservation-table td,
.wp-list-table.reservation-table th,
.wp-list-table.reservation-table td {
    text-align: center !important;
}
