/**
 * NivoSync Bookings — Admin Dashboard Premium Styles
 * Scoped to .nsb-admin-root for total WP admin isolation.
 * @package NivoSync_Bookings
 */

/* ─── Root ─── */
.nsb-admin-root {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #1a1a2e;
    max-width: 1200px;
    padding: 20px 0;
}
.nsb-admin-root * { box-sizing: border-box; }

/* ─── Page Header ─── */
.nsb-admin-root .nsb-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}
.nsb-admin-root .nsb-page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #1a1a2e;
}
.nsb-admin-root .nsb-page-subtitle {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
}
.nsb-admin-root .nsb-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
.nsb-admin-root .nsb-back-link {
    display: inline-block;
    font-size: 13px;
    color: #1a1a1a;
    text-decoration: none;
    margin-bottom: 8px;
}
.nsb-admin-root .nsb-back-link:hover { text-decoration: underline; }

/* ═══════ Stats Grid ═══════ */
.nsb-admin-root .nsb-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.nsb-admin-root .nsb-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow 0.2s;
}
.nsb-admin-root .nsb-stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.nsb-admin-root .nsb-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nsb-admin-root .nsb-stat-icon .dashicons { font-size: 24px; width: 24px; height: 24px; }
.nsb-admin-root .nsb-stat-icon--total { background: rgba(26,26,26,0.1); color: #1a1a1a; }
.nsb-admin-root .nsb-stat-icon--today { background: rgba(23,162,184,0.1); color: #17a2b8; }
.nsb-admin-root .nsb-stat-icon--week  { background: rgba(240,173,78,0.1); color: #f0ad4e; }
.nsb-admin-root .nsb-stat-icon--month { background: rgba(111,66,193,0.1); color: #6f42c1; }
.nsb-admin-root .nsb-stat-content { flex: 1; min-width: 0; }
.nsb-admin-root .nsb-stat-number { display: block; font-size: 28px; font-weight: 700; line-height: 1.1; color: #1a1a2e; }
.nsb-admin-root .nsb-stat-label  { display: block; font-size: 13px; color: #6c757d; margin-top: 4px; }

/* ═══════ Card ═══════ */
.nsb-admin-root .nsb-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}
.nsb-admin-root .nsb-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

/* ═══════ Filters ═══════ */
.nsb-admin-root .nsb-filters { margin-bottom: 16px; }
.nsb-admin-root .nsb-filters-form { display: flex; }
.nsb-admin-root .nsb-filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.nsb-admin-root .nsb-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.nsb-admin-root .nsb-search-wrap .dashicons {
    position: absolute;
    left: 12px;
    color: #adb5bd;
    font-size: 16px;
    width: 16px;
    height: 16px;
}
.nsb-admin-root .nsb-search-input {
    padding: 9px 14px 9px 36px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    min-width: 280px;
    transition: border-color 0.2s;
}
.nsb-admin-root .nsb-search-input:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}
.nsb-admin-root .nsb-date-input,
.nsb-admin-root .nsb-select-input {
    padding: 9px 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s;
}
.nsb-admin-root .nsb-date-input:focus,
.nsb-admin-root .nsb-select-input:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

/* ═══════ Table ═══════ */
.nsb-admin-root .nsb-table-wrap { overflow-x: auto; }
.nsb-admin-root .nsb-table { width: 100%; border-collapse: collapse; }
.nsb-admin-root .nsb-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6c757d;
    border-bottom: 2px solid #e9ecef;
    font-weight: 700;
    white-space: nowrap;
}
.nsb-admin-root .nsb-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    font-size: 14px;
}
.nsb-admin-root .nsb-table tbody tr:hover { background: #f8f9fa; }
.nsb-admin-root .nsb-table tbody tr:last-child td { border-bottom: none; }
.nsb-admin-root .nsb-td-name strong { color: #1a1a2e; }
.nsb-admin-root .nsb-table td a { color: #1a1a1a; text-decoration: none; }
.nsb-admin-root .nsb-table td a:hover { text-decoration: underline; }
.nsb-admin-root .nsb-th-actions { text-align: right; }
.nsb-admin-root .nsb-td-actions { text-align: right; white-space: nowrap; }
.nsb-admin-root .nsb-td-nowrap { white-space: nowrap; }

/* ─── Action Buttons ─── */
.nsb-admin-root .nsb-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    background: transparent;
}
.nsb-admin-root .nsb-action-btn .dashicons { font-size: 16px; width: 16px; height: 16px; }
.nsb-admin-root .nsb-action-btn--view { color: #1a1a1a; }
.nsb-admin-root .nsb-action-btn--view:hover { background: rgba(0,0,0,0.1); }
.nsb-admin-root .nsb-action-btn--edit { color: #17a2b8; }
.nsb-admin-root .nsb-action-btn--edit:hover { background: rgba(23,162,184,0.1); }
.nsb-admin-root .nsb-action-btn--delete { color: #dc3545; }
.nsb-admin-root .nsb-action-btn--delete:hover { background: rgba(220,53,69,0.1); }
.nsb-admin-root .nsb-action-btn--confirm { color: #28a745; }
.nsb-admin-root .nsb-action-btn--confirm:hover { background: rgba(40,167,69,0.1); }

/* ═══════ Badges ═══════ */
.nsb-admin-root .nsb-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    line-height: 1.4;
}
.nsb-admin-root .nsb-badge--pending   { background: rgba(240,173,78,0.15); color: #c87f0a; }
.nsb-admin-root .nsb-badge--confirmed { background: rgba(40,167,69,0.15);  color: #1e7e34; }
.nsb-admin-root .nsb-badge--cancelled { background: rgba(220,53,69,0.15);  color: #c82333; }
.nsb-admin-root .nsb-badge--info      { background: rgba(23,162,184,0.15); color: #117a8b; }
.nsb-admin-root .nsb-badge--warning   { background: rgba(240,173,78,0.15); color: #c87f0a; }
.nsb-admin-root .nsb-badge--error     { background: rgba(220,53,69,0.15);  color: #c82333; }

/* ═══════ Buttons ═══════ */
.nsb-admin-root .nsb-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.4;
}
.nsb-admin-root .nsb-btn .dashicons { font-size: 16px; width: 16px; height: 16px; }
.nsb-admin-root .nsb-btn--primary { background: #1a1a1a; color: #fff; }
.nsb-admin-root .nsb-btn--primary:hover { background: #333333; color: #fff; }
.nsb-admin-root .nsb-btn--danger  { background: #dc3545; color: #fff; }
.nsb-admin-root .nsb-btn--danger:hover  { background: #c82333; color: #fff; }
.nsb-admin-root .nsb-btn--outline { background: transparent; border: 1px solid #dee2e6; color: #495057; }
.nsb-admin-root .nsb-btn--outline:hover { border-color: #1a1a1a; color: #1a1a1a; }
.nsb-admin-root .nsb-btn--ghost   { background: transparent; color: #6c757d; }
.nsb-admin-root .nsb-btn--ghost:hover   { color: #1a1a2e; }
.nsb-admin-root .nsb-btn--sm { padding: 5px 12px; font-size: 13px; }
.nsb-admin-root .nsb-btn--lg { padding: 12px 28px; font-size: 15px; }

/* ═══════ Pagination ═══════ */
.nsb-admin-root .nsb-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}
.nsb-admin-root .nsb-pagination-info { font-size: 13px; color: #6c757d; }
.nsb-admin-root .nsb-pagination-buttons { display: flex; gap: 4px; }
.nsb-admin-root .nsb-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid #dee2e6;
    color: #495057;
    background: #fff;
    transition: all 0.2s;
}
.nsb-admin-root .nsb-page-btn:hover { border-color: #1a1a1a; color: #1a1a1a; }
.nsb-admin-root .nsb-page-btn--active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

/* ═══════ Empty State ═══════ */
.nsb-admin-root .nsb-empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #adb5bd;
}
.nsb-admin-root .nsb-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
}
.nsb-admin-root .nsb-empty-state p { font-size: 15px; margin: 0; }

/* ═══════ Detail View ═══════ */
.nsb-admin-root .nsb-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.nsb-admin-root .nsb-detail-card {
    padding: 0;
    overflow: hidden;
}
.nsb-admin-root .nsb-detail-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}
.nsb-admin-root .nsb-detail-card-header .dashicons { color: #1a1a1a; font-size: 20px; width: 20px; height: 20px; }
.nsb-admin-root .nsb-detail-card-header h3 { font-size: 14px; font-weight: 600; margin: 0; color: #1a1a2e; text-transform: uppercase; letter-spacing: 0.5px; }
.nsb-admin-root .nsb-detail-card-body { padding: 16px 20px; }
.nsb-admin-root .nsb-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.nsb-admin-root .nsb-detail-row:last-child { border-bottom: none; }
.nsb-admin-root .nsb-detail-label { font-size: 13px; color: #6c757d; min-width: 80px; }
.nsb-admin-root .nsb-detail-value { font-size: 14px; font-weight: 500; color: #1a1a2e; text-align: right; }
.nsb-admin-root .nsb-detail-value a { color: #1a1a1a; text-decoration: none; }
.nsb-admin-root .nsb-detail-value a:hover { text-decoration: underline; }
.nsb-admin-root .nsb-detail-value--block { text-align: left; white-space: pre-wrap; word-break: break-word; }

/* ═══════ Edit Form ═══════ */
.nsb-admin-root .nsb-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.nsb-admin-root .nsb-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.nsb-admin-root .nsb-form-group { margin-bottom: 16px; }
.nsb-admin-root .nsb-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 6px;
}
.nsb-admin-root .nsb-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #fff;
    font-family: inherit;
}
.nsb-admin-root .nsb-input:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}
.nsb-admin-root .nsb-textarea { min-height: 100px; resize: vertical; }
.nsb-admin-root .nsb-form-footer {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-top: 16px;
}

/* ═══════ Tabs (Settings) ═══════ */
.nsb-admin-root .nsb-tabs {
    display: flex;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 0;
}
.nsb-admin-root .nsb-tab {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.nsb-admin-root .nsb-tab:hover { color: #1a1a1a; }
.nsb-admin-root .nsb-tab--active {
    color: #1a1a1a;
    border-bottom-color: #1a1a1a;
    font-weight: 600;
}

/* ─── Settings Card ─── */
.nsb-admin-root .nsb-settings-card { padding: 0; }
.nsb-admin-root .nsb-settings-body { padding: 24px; }
.nsb-admin-root .nsb-settings-footer {
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}
.nsb-admin-root .nsb-settings-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 6px;
}
.nsb-admin-root .nsb-input--settings { max-width: 500px; }
.nsb-admin-root .nsb-input--number  { max-width: 160px; }
.nsb-admin-root .nsb-field-description {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
    max-width: 500px;
}

/* ─── Toggle Switch ─── */
.nsb-admin-root .nsb-form-group label.nsb-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    margin-bottom: 0;
    font-weight: normal;
    font-size: inherit;
    color: inherit;
}
.nsb-admin-root .nsb-toggle input[type="checkbox"] { display: none; }
.nsb-admin-root .nsb-toggle-slider {
    width: 44px;
    height: 24px;
    background: #cdd3d8;
    border: 1px solid #bfc5cc;
    border-radius: 12px;
    position: relative;
    transition: background 0.2s, border-color 0.2s;
}
.nsb-admin-root .nsb-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}
.nsb-admin-root .nsb-toggle input:checked + .nsb-toggle-slider {
    background: #1a1a1a;
    border-color: #333333;
}
.nsb-admin-root .nsb-toggle input:checked + .nsb-toggle-slider::after {
    transform: translateX(20px);
}
.nsb-admin-root .nsb-toggle + .nsb-field-description {
    margin-top: 8px;
}

/* ─── Calendar Status Indicator ─── */
.nsb-admin-root .nsb-calendar-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}
.nsb-admin-root .nsb-calendar-status .dashicons { font-size: 20px; width: 20px; height: 20px; }
.nsb-admin-root .nsb-calendar-status--ok {
    background: rgba(40,167,69,0.1);
    color: #1e7e34;
    border: 1px solid rgba(40,167,69,0.2);
}
.nsb-admin-root .nsb-calendar-status--error {
    background: rgba(220,53,69,0.1);
    color: #c82333;
    border: 1px solid rgba(220,53,69,0.2);
}

/* ─── Credentials Status Indicator ─── */
.nsb-admin-root .nsb-credentials-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 500;
}
.nsb-admin-root .nsb-credentials-status .dashicons { font-size: 18px; width: 18px; height: 18px; }
.nsb-admin-root .nsb-credentials-status code {
    background: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}
.nsb-admin-root .nsb-credentials-status--ok {
    background: rgba(40,167,69,0.1);
    color: #1e7e34;
    border: 1px solid rgba(40,167,69,0.2);
}
.nsb-admin-root .nsb-credentials-status--warning {
    background: rgba(240,173,78,0.1);
    color: #c87f0a;
    border: 1px solid rgba(240,173,78,0.2);
}
.nsb-admin-root .nsb-credentials-status--error {
    background: rgba(220,53,69,0.08);
    color: #c82333;
    border: 1px solid rgba(220,53,69,0.15);
}

/* ═══════ Toast Notification ═══════ */
.nsb-admin-root .nsb-toast {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    animation: nsb-toast-in 0.3s ease-out;
}
.nsb-admin-root .nsb-toast--success {
    background: #e8e8e8;
    color: #1a1a1a;
    border: 1px solid #d5d5d5;
}
.nsb-admin-root .nsb-toast--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes nsb-toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Time Slots Picker ─── */
.nsb-admin-root .nsb-time-slots-picker {
    max-width: 360px;
}
.nsb-admin-root .nsb-time-slots-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}
.nsb-admin-root .nsb-time-slot-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nsb-admin-root .nsb-time-slot-input {
    flex: 1;
    max-width: 160px;
}
.nsb-admin-root .nsb-time-slot-remove {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    color: #dc3545;
    background: rgba(220,53,69,0.08);
    border: 1px solid rgba(220,53,69,0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.nsb-admin-root .nsb-time-slot-remove:hover {
    background: rgba(220,53,69,0.15);
    color: #a71d2a;
}
.nsb-admin-root .nsb-time-slot-add {
    width: 100%;
    max-width: 360px;
    border-style: dashed;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.nsb-admin-root .nsb-time-slot-add .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ─── Closed Days Picker ─── */
.nsb-admin-root .nsb-closed-days-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}
.nsb-admin-root .nsb-day-btn {
    padding: 8px 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    color: #495057;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.nsb-admin-root .nsb-day-btn:hover {
    background: #e9ecef;
    border-color: #ced4da;
}
.nsb-admin-root .nsb-day-btn--active {
    background: #1a1a1a;
    color: #fff;
    border-color: #333333;
}
.nsb-admin-root .nsb-day-btn--active:hover {
    background: #333333;
    border-color: #000000;
}

/* ─── Logo Preview ─── */
.nsb-admin-root .nsb-logo-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}
.nsb-admin-root .nsb-logo-preview img {
    flex-shrink: 0;
}
.nsb-admin-root .nsb-remove-logo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #dc3545;
    cursor: pointer;
    font-weight: normal;
}
.nsb-admin-root .nsb-remove-logo input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* ═══════ Responsive ═══════ */
@media (max-width: 1024px) {
    .nsb-admin-root .nsb-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .nsb-admin-root .nsb-detail-grid { grid-template-columns: 1fr; }
    .nsb-admin-root .nsb-edit-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .nsb-admin-root .nsb-stats-grid { grid-template-columns: 1fr; }
    .nsb-admin-root .nsb-page-header { flex-direction: column; gap: 12px; }
    .nsb-admin-root .nsb-form-row { grid-template-columns: 1fr; }
    .nsb-admin-root .nsb-filter-group { flex-direction: column; width: 100%; }
    .nsb-admin-root .nsb-search-input { min-width: auto; width: 100%; }
    .nsb-admin-root .nsb-tabs { overflow-x: auto; }
}
