/* ============================================
   ADMIN PAGE EXTENSIONS
   Builds on calendar-styles.css + theme tokens
   ============================================ */

/* --------------------------------------------
   Wrapper adjustments
   -------------------------------------------- */
/* Ensure all admin layout containers respect wrapper width */
.admin-wrapper,
.admin-grid-container,
.admin-actions-container,
.admin-actions-inner,
.admin-actions-row {
    box-sizing: border-box;
}

.admin-wrapper {
    width: 95%;                        /* slightly wider than before */
    max-width: 1500px;                 /* increased from 1400px */
    margin: 20px auto;                 /* center it */
    padding: 20px;
    background: var(--color-surface-glass);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-glass);
    box-shadow: var(--shadow-glass);
}

/* --------------------------------------------
   Filters
   -------------------------------------------- */

.admin-filters .filters-bar select,
.admin-filters .filters-bar input[type="date"] {
    width: 180px;
    height: 38px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--color-input-border);
    background: var(--color-input-bg);
    font-size: 0.9rem;
    box-sizing: border-box;
}

.admin-filters .filters-row {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    align-items: center;
}

.filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

/* --------------------------------------------
   Grid container (expanded, cleaner)
   -------------------------------------------- */

.admin-grid-container {
    margin-top: 20px;
    background: var(--color-surface-date);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-date);
    padding: 16px;
    box-shadow: var(--shadow-grid);
    overflow-x: auto;

    width: 100%;        /* EXACTLY match wrapper width */
    max-width: 100%;    /* no internal constraint */
}


/* ============================================
   ADMIN GRID — CLICKABLE ID COLUMN
   ============================================ */

/* Neutralise the ID column cell so it doesn't inherit
   background, borders, or padding from other admin styles */
td.col-id {
    background: none !important;
    border: none !important;
    padding: 4px 6px !important;
    font-size: inherit !important;   /* restore normal grid font-size */
}

/* Make the ID look like a clickable text link */
.id-info-link {
    color: inherit !important;          /* use normal text colour */
    text-decoration: underline;
    cursor: pointer;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    display: inline-block;
    line-height: 1.2;
}

/* Slightly thicker underline on hover for feedback */
.id-info-link:hover {
    text-decoration-thickness: 2px;
}

/* Header icon next to "ID" */
.id-info-icon {
    font-size: 0.8em;
    margin-left: 4px;
    opacity: 0.6;
    vertical-align: middle;
}

/* ============================================
   AUDIT LOG MODAL FORMATTING
   ============================================ */

.audit-log-wrapper {
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px 0;
}

/* Table layout */
.audit-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.audit-log-table th,
.audit-log-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
}

/* Date column: two lines */
.audit-date div {
    line-height: 1.2;
}

/* Prevent wrapping in Details column */
.audit-details {
    white-space: nowrap;
}

/* --------------------------------------------
   Table styling
   -------------------------------------------- */

.admin-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-grid thead th {
    text-align: left;
    padding: 10px 8px;
    background: var(--color-surface-day-header);
    border-bottom: 1px solid var(--color-border-date);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.admin-grid tbody td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--color-border-date);
}

.admin-grid tbody tr:hover {
    background: var(--color-surface-date-hover);
}

.admin-grid input[type="checkbox"] {
    transform: scale(1.2);
}

.admin-grid .col-email {
    min-width: 180px;
    word-break: break-all;
}

.admin-grid select,
.admin-grid input[type="text"],
.admin-grid textarea {
    width: 100%;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid var(--color-input-border);
    background: var(--color-input-bg);
    font-size: 0.85rem;
    box-sizing: border-box;
}

.admin-grid textarea {
    resize: vertical;
    min-height: 32px;
}

.admin-grid th:first-child,
.admin-grid td:first-child {
    width: 32px;
    text-align: center;
}

/* ============================
   INLINE CONFLICT MESSAGE (GRID)
   ============================ */

.admin-conflict-message {
    background: #fff3cd;          /* soft amber */
    border: 1px solid #ffeeba;    /* subtle border */
    color: #856404;               /* readable amber text */
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    line-height: 1.2;
    margin: 0;
}

.admin-conflict-message strong {
    font-weight: 600;
}

/* --------------------------------------------
   Paging
   -------------------------------------------- */

.admin-paging {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
}

.admin-paging button {
    padding: 6px 14px;
    border-radius: var(--radius-pill-full);
    border: 1px solid var(--color-border-nav);
    background: rgba(255, 255, 255, var(--opacity-xlow));
    color: var(--color-text-primary);
    cursor: pointer;
    transition: background var(--transition-med), transform var(--transition-fast);
}

/* --------------------------------------------
   Admin Actions
   -------------------------------------------- */

.admin-actions-container {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-md);   /* match filters + grid */
}

.admin-actions-inner,
.admin-actions-row {
    width: 100%;
}

.admin-actions-inner {
    width: 100%;
    display: flex;
    justify-content: center;
}

.admin-actions-row {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.send-email-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

/* Make disabled admin action buttons visibly disabled */
#actionUpdate:disabled,
#actionRemove:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    background-color: #ccc !important;
    border-color: #bbb !important;
    color: #666 !important;
}

/* Remove hover styling when disabled */
#actionUpdate:disabled:hover,
#actionRemove:disabled:hover {
    background-color: #ccc !important;
}

/* Fix the entire suppress email row */
#bookingModal .form-group.admin-email-field {
    display: flex !important;
    flex-direction: row !important;   /* override the public column layout */
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
}

/* Keep label + checkbox tight */
#bookingModal .form-group.admin-email-field label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
}

/* Conflict hint below form */
.conflict-hint {
    color: var(--color-text-error);
    font-weight: 750;
    margin-top: 6px;
    font-size: 0.9rem;
}

/* Prevent checkbox drifting */
#bookingModal .form-group.admin-email-field input[type="checkbox"] {
    margin: 0 !important;
}

.success-message {
    text-align: center;
    padding: 30px 10px;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --------------------------------------------
   Back to Home link
   -------------------------------------------- */
.back-to-home {
    margin: 30px auto;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-primary);
    opacity: 0.9;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.back-to-home:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.booking-section {
    z-index: 0;
}

.back-to-home {
    z-index: 9999;
    pointer-events: auto;
}
