/**
 * Beauty Salon Bookings - Frontend Staff Portal Styles
 * Beautiful, modern calendar for staff members
 */

/* ==========================================
   CSS Variables
   ========================================== */
:root {
    --bsb-primary: #6366f1;
    --bsb-primary-hover: #4f46e5;
    --bsb-success: #10b981;
    --bsb-warning: #f59e0b;
    --bsb-danger: #ef4444;
    --bsb-info: #3b82f6;
    --bsb-gray-50: #f8fafc;
    --bsb-gray-100: #f1f5f9;
    --bsb-gray-200: #e2e8f0;
    --bsb-gray-300: #cbd5e1;
    --bsb-gray-400: #94a3b8;
    --bsb-gray-500: #64748b;
    --bsb-gray-600: #475569;
    --bsb-gray-700: #334155;
    --bsb-gray-800: #1e293b;
    --bsb-gray-900: #0f172a;
    --bsb-radius: 12px;
    --bsb-radius-sm: 8px;
    --bsb-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --bsb-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   Main Container
   ========================================== */
.bsb-staff-portal {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    width: 100%;
    margin: 0;
    padding: 0;
    color: var(--bsb-gray-800);
}

.bsb-staff-portal *,
.bsb-staff-portal *::before,
.bsb-staff-portal *::after {
    box-sizing: border-box;
}

/* ==========================================
   Header
   ========================================== */
.bsb-portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 24px;
    background: linear-gradient(135deg, var(--bsb-primary) 0%, #8b5cf6 100%);
    border-radius: var(--bsb-radius);
    color: white;
}

.bsb-portal-welcome {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bsb-portal-avatar {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
}

.bsb-portal-info h2 {
    margin: 0 0 4px 0;
    font-size: 24px;
    font-weight: 600;
    color: white;
}

.bsb-portal-info p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

/* ==========================================
   Buttons
   ========================================== */
.bsb-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--bsb-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.bsb-btn-primary {
    background: white;
    color: var(--bsb-primary);
}

.bsb-btn-primary:hover {
    background: var(--bsb-gray-100);
    transform: translateY(-1px);
}

.bsb-btn-secondary {
    background: var(--bsb-gray-200);
    color: var(--bsb-gray-700);
}

.bsb-btn-secondary:hover {
    background: var(--bsb-gray-300);
}

.bsb-btn-danger {
    background: var(--bsb-danger);
    color: white;
}

.bsb-btn-danger:hover {
    background: #dc2626;
}

.bsb-icon {
    font-size: 18px;
    font-weight: 700;
}

/* ==========================================
   Stats Cards
   ========================================== */
.bsb-portal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.bsb-pstat-card {
    background: white;
    border-radius: var(--bsb-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--bsb-shadow);
    border: 1px solid var(--bsb-gray-100);
}

.bsb-pstat-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.bsb-pstat-icon.total { background: #e0e7ff; }
.bsb-pstat-icon.confirmed { background: #d1fae5; }
.bsb-pstat-icon.pending { background: #fef3c7; }

.bsb-pstat-data {
    display: flex;
    flex-direction: column;
}

.bsb-pstat-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--bsb-gray-800);
    line-height: 1;
}

.bsb-pstat-label {
    font-size: 13px;
    color: var(--bsb-gray-500);
    margin-top: 4px;
}

/* ==========================================
   Calendar Controls
   ========================================== */
.bsb-portal-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.bsb-view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bsb-gray-100);
    padding: 4px;
    border-radius: var(--bsb-radius-sm);
}

.bsb-view-btn {
    padding: 10px 20px;
    text-decoration: none;
    color: var(--bsb-gray-600);
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.bsb-view-btn:hover {
    background: white;
    color: var(--bsb-gray-800);
}

.bsb-view-btn.active {
    background: white;
    color: var(--bsb-primary);
    box-shadow: var(--bsb-shadow);
}

.bsb-date-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bsb-nav-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--bsb-gray-200);
    border-radius: var(--bsb-radius-sm);
    text-decoration: none;
    color: var(--bsb-gray-600);
    font-size: 18px;
    transition: all 0.2s ease;
}

.bsb-nav-btn:hover {
    background: var(--bsb-gray-50);
    border-color: var(--bsb-gray-300);
}

.bsb-date-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--bsb-gray-800);
    min-width: 200px;
    text-align: center;
}

.bsb-today-btn {
    padding: 10px 16px;
    background: var(--bsb-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--bsb-radius-sm);
    font-weight: 500;
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.bsb-today-btn:hover {
    background: var(--bsb-primary-hover);
    color: white;
}

/* Date Picker Button */
.bsb-datepicker-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.bsb-datepicker-btn {
    cursor: pointer;
}

.bsb-datepicker-wrap .bsb-datepicker-input {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    border: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

/* ==========================================
   Calendar Container
   ========================================== */
.bsb-portal-calendar {
    background: white;
    border-radius: var(--bsb-radius);
    box-shadow: var(--bsb-shadow);
    border: 1px solid var(--bsb-gray-100);
    overflow: hidden;
}

/* Horizontal scroll wrapper for week/month on small screens */
.bsb-portal-calendar-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================
   Day View — Lane-based (same architecture as admin calendar)
   ========================================== */
.bsb-day-calendar {
    min-height: 500px;
}

.bsb-day-header {
    padding: 20px 24px;
    background: var(--bsb-gray-50);
    border-bottom: 1px solid var(--bsb-gray-200);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bsb-day-date {
    font-size: 14px;
    color: var(--bsb-gray-500);
    text-transform: capitalize;
}

.bsb-day-full {
    font-size: 20px;
    font-weight: 600;
    color: var(--bsb-gray-800);
}

/* Day body: time gutter + single lane side by side */
.bsb-day-body {
    display: flex;
    width: 100%;
    position: relative;
}

/* Time Gutter (left column with hour labels) */
.bsb-time-gutter {
    width: 70px;
    min-width: 70px;
    flex-shrink: 0;
    background: var(--bsb-gray-50);
    border-right: 2px solid var(--bsb-gray-200);
}

.bsb-time-gutter .bsb-time-label {
    height: var(--bsb-slot-height, 25px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--bsb-gray-500);
    border-bottom: 1px solid var(--bsb-gray-200);
    box-sizing: border-box;
}

.bsb-time-gutter .bsb-time-label.bsb-half {
    font-size: 11px;
    font-weight: 500;
    color: var(--bsb-gray-400);
    border-bottom-color: var(--bsb-gray-100);
}

.bsb-time-gutter .bsb-time-label.bsb-quarter {
    font-size: 10px;
    font-weight: 400;
    color: var(--bsb-gray-300);
    border-bottom-color: var(--bsb-gray-50);
}

/* Staff Lane: single column for this worker */
.bsb-day-body .bsb-lane {
    flex: 1;
    position: relative;
}

/* Slot cells (clickable 15-min rows within the lane) */
.bsb-lane .bsb-staff-cell {
    height: var(--bsb-slot-height, 25px);
    box-sizing: border-box;
    border-bottom: 1px solid var(--bsb-gray-200);
    cursor: pointer;
    transition: background 0.15s;
    padding: 2px 4px;
    position: relative;
}

.bsb-lane .bsb-staff-cell.bsb-half {
    border-bottom-color: var(--bsb-gray-100);
}

.bsb-lane .bsb-staff-cell.bsb-quarter {
    border-bottom-color: var(--bsb-gray-50);
}

.bsb-lane .bsb-staff-cell:hover {
    background: var(--bsb-gray-50);
}

/* Timeoff slots */
.bsb-staff-cell.bsb-break-slot {
    background: repeating-linear-gradient(
        45deg,
        #f1f5f9,
        #f1f5f9 10px,
        #e2e8f0 10px,
        #e2e8f0 20px
    );
    cursor: not-allowed;
}

.bsb-staff-cell.bsb-vacation-slot {
    background: repeating-linear-gradient(
        45deg,
        #fef3c7,
        #fef3c7 10px,
        #fef9c3 10px,
        #fef9c3 20px
    );
    cursor: not-allowed;
}

/* Timeoff indicator (absolutely positioned, spans multiple slots) */
.bsb-timeoff-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--bsb-radius-sm);
    font-size: 13px;
    font-weight: 600;
    position: absolute;
    top: 0;
    left: 3px;
    right: 3px;
    height: calc(var(--tf-span, 1) * var(--bsb-slot-height, 25px));
    z-index: 4;
    overflow: hidden;
}

.bsb-break-slot .bsb-timeoff-indicator {
    background: rgba(148, 163, 184, 0.15);
    color: #475569;
}

.bsb-vacation-slot .bsb-timeoff-indicator {
    background: rgba(245, 158, 11, 0.15);
    color: #92400e;
}

.bsb-timeoff-label {
    font-weight: 700;
}

.bsb-timeoff-reason {
    font-weight: 400;
    font-size: 12px;
    opacity: 0.8;
}

/* Booking card (absolutely positioned within lane — same as admin) */
.bsb-staff-booking {
    position: absolute;
    top: calc(var(--slot-offset, 0) * var(--bsb-slot-height, 25px));
    min-height: calc(var(--slot-span, 2) * var(--bsb-slot-height, 25px));
    left: 3px;
    right: 3px;
    z-index: 5;
    background: white;
    border-radius: var(--bsb-radius-sm);
    padding: 10px 12px;
    border-left: 4px solid var(--bsb-gray-300);
    box-shadow: var(--bsb-shadow);
    cursor: default;
    display: flex;
    flex-direction: column;
    overflow: visible;
    box-sizing: border-box;
    transition: box-shadow 0.2s;
}

.bsb-staff-booking:hover {
    box-shadow: 0 8px 20px -4px rgba(0,0,0,.18);
    z-index: 20;
}

.bsb-staff-booking.status-pending {
    border-left-color: var(--bsb-warning);
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.bsb-staff-booking.status-confirmed {
    border-left-color: var(--bsb-success);
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.bsb-staff-booking.status-completed {
    border-left-color: var(--bsb-info);
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.bsb-staff-booking.status-cancelled {
    border-left-color: var(--bsb-danger);
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    opacity: 0.65;
}

/* Booking card inner elements */
.bsb-sb-time {
    font-size: 13px;
    font-weight: 800;
    color: var(--bsb-gray-800);
    margin-bottom: 4px;
}

.bsb-sb-client {
    font-size: 14px;
    font-weight: 700;
    color: var(--bsb-gray-800);
    margin-bottom: 2px;
}

.bsb-sb-phone {
    font-size: 12px;
    color: var(--bsb-gray-500);
    margin-bottom: 6px;
}

.bsb-sb-services {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.bsb-service-tag {
    background: var(--bsb-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.bsb-bc-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px solid rgba(0,0,0,.06);
}

.bsb-action-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bsb-gray-100);
    border-radius: var(--bsb-radius-sm);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.bsb-action-btn:hover {
    background: var(--bsb-gray-200);
    transform: scale(1.05);
}

/* ==========================================
   Week View
   ========================================== */
.bsb-week-calendar {
    min-height: 500px;
}

.bsb-week-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bsb-gray-50);
    border-bottom: 1px solid var(--bsb-gray-200);
}

.bsb-week-day-header {
    padding: 16px;
    text-align: center;
    border-right: 1px solid var(--bsb-gray-100);
}

.bsb-week-day-header:last-child {
    border-right: none;
}

.bsb-week-day-header.today {
    background: var(--bsb-primary);
}

.bsb-week-day-header.today .bsb-wdh-name,
.bsb-week-day-header.today .bsb-wdh-num {
    color: white;
}

.bsb-wdh-name {
    display: block;
    font-size: 12px;
    color: var(--bsb-gray-500);
    text-transform: uppercase;
    font-weight: 600;
}

.bsb-wdh-num {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--bsb-gray-800);
    margin-top: 4px;
}

.bsb-week-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-height: 400px;
}

.bsb-week-day-col {
    border-right: 1px solid var(--bsb-gray-100);
    padding: 12px;
    min-height: 300px;
    min-width: 0;
}

.bsb-week-day-col:last-child {
    border-right: none;
}

.bsb-week-day-col.today {
    background: #f0f4ff;
}

.bsb-week-empty {
    color: var(--bsb-gray-400);
    font-size: 13px;
    text-align: center;
    padding: 20px 0;
}

/* Week View Timeoff Badge */
.bsb-week-timeoff-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--bsb-radius-sm);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
    position: relative;
}

.bsb-week-timeoff-badge.vacation {
    background: #fef3c7;
    color: #92400e;
    border-left: 3px solid #f59e0b;
}

.bsb-week-timeoff-badge.break {
    background: #e2e8f0;
    color: #475569;
    border-left: 3px solid #94a3b8;
}

.bsb-week-timeoff-badge .bsb-timeoff-reason {
    opacity: 0.8;
    font-weight: 400;
    font-size: 11px;
}

.bsb-week-timeoff-badge .bsb-break-delete-btn {
    margin-left: auto;
}

.bsb-week-day-col.has-timeoff {
    background: #fafbfc;
}

/* Month View Timeoff Badge */
.bsb-md-timeoff {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
}

.bsb-md-timeoff-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 8px;
}

.bsb-md-timeoff-badge.vacation {
    background: #fef3c7;
    color: #92400e;
}

.bsb-md-timeoff-badge.break {
    background: #e2e8f0;
    color: #475569;
}

.bsb-md-timeoff-badge span {
    font-size: 10px;
}

.bsb-month-day.has-timeoff {
    background: #fafbfc;
}

.bsb-week-booking {
    background: white;
    border-radius: var(--bsb-radius-sm);
    padding: 10px;
    margin-bottom: 8px;
    border-left: 3px solid var(--bsb-gray-300);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.bsb-week-booking.status-pending { border-left-color: var(--bsb-warning); }
.bsb-week-booking.status-confirmed { border-left-color: var(--bsb-success); }
.bsb-week-booking.status-completed { border-left-color: var(--bsb-info); }
.bsb-week-booking.status-cancelled { border-left-color: var(--bsb-danger); }

.bsb-wb-time {
    font-weight: 700;
    font-size: 14px;
    color: var(--bsb-gray-800);
}

.bsb-wb-client {
    font-size: 13px;
    color: var(--bsb-gray-600);
    margin: 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bsb-wb-service {
    font-size: 11px;
    color: var(--bsb-gray-500);
}

.bsb-wb-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.bsb-action-btn-sm {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bsb-gray-100);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.bsb-action-btn-sm:hover {
    background: var(--bsb-gray-200);
}

/* ==========================================
   Month View
   ========================================== */
.bsb-month-calendar-front {
    padding: 0;
}

.bsb-month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bsb-gray-50);
    border-bottom: 1px solid var(--bsb-gray-200);
}

.bsb-month-weekday {
    padding: 16px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--bsb-gray-500);
}

.bsb-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.bsb-month-day {
    min-height: 100px;
    border-right: 1px solid var(--bsb-gray-100);
    border-bottom: 1px solid var(--bsb-gray-100);
    padding: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.bsb-month-day:nth-child(7n) {
    border-right: none;
}

.bsb-month-day:hover {
    background: var(--bsb-gray-50);
}

.bsb-month-day.other-month {
    background: var(--bsb-gray-50);
    cursor: default;
}

.bsb-month-day.other-month .bsb-md-num {
    color: var(--bsb-gray-300);
}

.bsb-month-day.today {
    background: #f0f4ff;
}

.bsb-month-day.today .bsb-md-num {
    background: var(--bsb-primary);
    color: white;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.bsb-md-num {
    font-size: 14px;
    font-weight: 600;
    color: var(--bsb-gray-700);
    margin-bottom: 6px;
}

.bsb-md-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--bsb-primary);
    background: #e0e7ff;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 6px;
}

.bsb-md-preview {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bsb-md-booking {
    font-size: 11px;
    padding: 3px 6px;
    background: var(--bsb-gray-100);
    border-radius: 4px;
    color: var(--bsb-gray-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 2px solid var(--bsb-gray-300);
}

.bsb-md-booking.status-confirmed { border-left-color: var(--bsb-success); }
.bsb-md-booking.status-pending { border-left-color: var(--bsb-warning); }

.bsb-md-more {
    font-size: 10px;
    color: var(--bsb-gray-400);
    text-align: center;
}

/* ==========================================
   Modal
   ========================================== */
.bsb-staff-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: none; /* hidden by default */
    align-items: center;
    justify-content: center;
}

/* Force flex layout when jQuery makes it visible (display: block) */
.bsb-staff-modal[style*="display: block"],
.bsb-staff-modal[style*="display:block"] {
    display: flex !important;
}

.bsb-staff-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.bsb-staff-modal-content {
    position: relative;
    background: white;
    border-radius: var(--bsb-radius);
    box-shadow: var(--bsb-shadow-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    animation: bsbModalSlideIn 0.3s ease;
}

@keyframes bsbModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bsb-staff-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--bsb-gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bsb-staff-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--bsb-gray-800);
}

.bsb-staff-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bsb-gray-100);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    color: var(--bsb-gray-500);
    transition: all 0.2s ease;
}

.bsb-staff-modal-close:hover {
    background: var(--bsb-gray-200);
    color: var(--bsb-gray-700);
}

.bsb-staff-modal-body {
    padding: 24px;
}

.bsb-staff-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--bsb-gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Form Styles */
.bsb-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.bsb-form-group {
    margin-bottom: 16px;
}

.bsb-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--bsb-gray-700);
    margin-bottom: 6px;
}

.bsb-form-group input,
.bsb-form-group select,
.bsb-form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--bsb-gray-300);
    border-radius: var(--bsb-radius-sm);
    font-size: 14px;
    color: var(--bsb-gray-800);
    transition: all 0.2s ease;
}

.bsb-form-group input:focus,
.bsb-form-group select:focus,
.bsb-form-group textarea:focus {
    outline: none;
    border-color: var(--bsb-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.bsb-phone-wrap {
    display: flex;
    align-items: stretch;
}

.bsb-phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: var(--bsb-gray-100);
    border: 1px solid var(--bsb-gray-300);
    border-right: none;
    border-radius: var(--bsb-radius-sm) 0 0 var(--bsb-radius-sm);
    font-weight: 600;
    color: var(--bsb-gray-600);
}

.bsb-phone-wrap input {
    border-radius: 0 var(--bsb-radius-sm) var(--bsb-radius-sm) 0;
}

/* Confirm Dialog */
.bsb-confirm-dialog {
    max-width: 400px;
    text-align: center;
    padding: 32px;
}

.bsb-confirm-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.bsb-confirm-dialog h3 {
    margin: 0 0 12px 0;
    font-size: 20px;
}

.bsb-confirm-dialog p {
    margin: 0 0 24px 0;
    color: var(--bsb-gray-600);
}

.bsb-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ==========================================
   Responsive - Large tablets (1024px)
   ========================================== */
@media (max-width: 1024px) {
    .bsb-staff-portal {
        padding: 16px;
    }

    .bsb-portal-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .bsb-month-day {
        min-height: 80px;
    }

    .bsb-time-label {
        width: 60px;
        padding: 12px 8px;
        font-size: 13px;
    }
}

/* ==========================================
   Responsive - Tablets (768px)
   ========================================== */
@media (max-width: 768px) {
    .bsb-staff-portal {
        padding: 12px;
    }
    
    .bsb-portal-header {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 20px 16px;
    }
    
    .bsb-portal-welcome {
        flex-direction: column;
    }

    .bsb-portal-info h2 {
        font-size: 20px;
    }
    
    .bsb-portal-header-actions {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .bsb-btn {
        padding: 10px 18px;
        font-size: 13px;
    }

    .bsb-portal-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .bsb-pstat-card {
        padding: 14px;
        gap: 10px;
    }

    .bsb-pstat-icon {
        font-size: 24px;
        width: 44px;
        height: 44px;
    }

    .bsb-pstat-num {
        font-size: 22px;
    }

    .bsb-pstat-label {
        font-size: 12px;
    }
    
    .bsb-portal-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .bsb-view-toggle {
        width: 100%;
        justify-content: center;
    }

    .bsb-view-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .bsb-date-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .bsb-date-title {
        font-size: 16px;
        min-width: 160px;
    }
    
    .bsb-form-row {
        grid-template-columns: 1fr;
    }

    /* Day view responsive */
    .bsb-time-gutter {
        width: 55px;
        min-width: 55px;
    }

    .bsb-time-gutter .bsb-time-label {
        font-size: 11px;
    }

    .bsb-staff-booking {
        padding: 8px 10px;
    }

    .bsb-sb-time {
        font-size: 12px;
    }

    .bsb-sb-client {
        font-size: 13px;
    }

    .bsb-service-tag {
        font-size: 10px;
        padding: 1px 6px;
    }

    .bsb-bc-actions {
        flex-wrap: wrap;
    }

    .bsb-action-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    /* Week view responsive */
    .bsb-week-header,
    .bsb-week-body {
        grid-template-columns: repeat(7, 1fr);
    }

    .bsb-portal-calendar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .bsb-week-calendar {
        min-width: 560px;
    }

    .bsb-month-calendar-front {
        min-width: 500px;
    }
    
    .bsb-week-day-header {
        padding: 8px 4px;
    }
    
    .bsb-wdh-name {
        font-size: 10px;
    }
    
    .bsb-wdh-num {
        font-size: 16px;
    }
    
    .bsb-week-day-col {
        padding: 4px;
        min-height: 200px;
    }
    
    .bsb-week-booking {
        padding: 6px;
    }
    
    .bsb-wb-time {
        font-size: 12px;
    }
    
    .bsb-wb-client {
        font-size: 11px;
    }

    .bsb-wb-service {
        display: none;
    }

    .bsb-wb-actions {
        flex-wrap: wrap;
    }

    .bsb-action-btn-sm {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    /* Month view responsive */
    .bsb-month-day {
        min-height: 70px;
        padding: 6px;
    }

    .bsb-month-weekday {
        padding: 10px 4px;
        font-size: 11px;
    }

    .bsb-md-num {
        font-size: 13px;
    }

    .bsb-md-booking {
        font-size: 10px;
        padding: 2px 4px;
    }

    .bsb-md-count {
        font-size: 10px;
        padding: 1px 6px;
    }

    /* Modal responsive */
    .bsb-staff-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .bsb-staff-modal-header {
        padding: 16px 20px;
    }

    .bsb-staff-modal-header h3 {
        font-size: 18px;
    }

    .bsb-staff-modal-body {
        padding: 16px 20px;
    }

    .bsb-staff-modal-footer {
        padding: 12px 20px;
    }

    /* Toast */
    .bsb-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }
}

/* ==========================================
   Responsive - Small phones (480px)
   ========================================== */
@media (max-width: 480px) {
    .bsb-staff-portal {
        padding: 8px;
    }

    .bsb-portal-header {
        padding: 16px 12px;
        border-radius: 8px;
        margin-bottom: 12px;
    }

    .bsb-portal-avatar {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .bsb-portal-info h2 {
        font-size: 17px;
    }

    .bsb-portal-info p {
        font-size: 12px;
    }

    .bsb-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    .bsb-portal-stats {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
        margin-bottom: 12px;
    }

    .bsb-pstat-card {
        padding: 10px 8px;
        gap: 6px;
        flex-direction: column;
        text-align: center;
    }

    .bsb-pstat-icon {
        font-size: 20px;
        width: 36px;
        height: 36px;
    }

    .bsb-pstat-num {
        font-size: 18px;
    }

    .bsb-pstat-label {
        font-size: 10px;
    }

    .bsb-portal-controls {
        margin-bottom: 12px;
        gap: 8px;
    }

    .bsb-view-toggle {
        padding: 3px;
    }

    .bsb-view-btn {
        padding: 7px 10px;
        font-size: 12px;
    }

    .bsb-date-nav {
        gap: 6px;
    }

    .bsb-nav-btn {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .bsb-date-title {
        font-size: 14px;
        min-width: auto;
    }

    .bsb-today-btn {
        padding: 7px 12px;
        font-size: 12px;
    }

    /* Day view small */
    .bsb-day-header {
        padding: 12px 10px;
    }

    .bsb-day-date {
        font-size: 12px;
    }

    .bsb-day-full {
        font-size: 16px;
    }

    .bsb-time-gutter {
        width: 46px;
        min-width: 46px;
    }

    .bsb-time-gutter .bsb-time-label {
        font-size: 10px;
    }

    .bsb-staff-booking {
        padding: 6px 8px;
    }

    .bsb-sb-time {
        font-size: 11px;
    }

    .bsb-sb-client {
        font-size: 12px;
    }

    .bsb-sb-phone {
        font-size: 10px;
    }

    .bsb-action-btn {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    .bsb-bc-phone {
        font-size: 12px;
    }

    .bsb-bc-services {
        gap: 4px;
        margin-bottom: 8px;
    }

    .bsb-bc-service-tag {
        font-size: 10px;
        padding: 2px 6px;
    }

    .bsb-action-btn {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }

    /* Week view small */
    .bsb-week-day-header {
        padding: 6px 2px;
    }

    .bsb-wdh-name {
        font-size: 9px;
    }

    .bsb-wdh-num {
        font-size: 14px;
    }

    .bsb-week-day-col {
        padding: 3px;
        min-height: 150px;
    }

    .bsb-week-booking {
        padding: 4px;
        margin-bottom: 4px;
        border-left-width: 2px;
    }

    .bsb-wb-time {
        font-size: 10px;
    }

    .bsb-wb-client {
        display: none;
    }

    .bsb-wb-actions {
        margin-top: 4px;
    }

    .bsb-action-btn-sm {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }

    /* Month view small */
    .bsb-month-header {
        border-bottom: none;
    }

    .bsb-month-weekday {
        padding: 8px 2px;
        font-size: 9px;
    }

    .bsb-month-day {
        min-height: 50px;
        padding: 4px;
    }

    .bsb-md-num {
        font-size: 12px;
        margin-bottom: 2px;
    }

    .bsb-md-count {
        font-size: 9px;
        padding: 1px 4px;
    }

    .bsb-md-preview {
        gap: 2px;
    }

    .bsb-md-booking {
        font-size: 9px;
        padding: 1px 3px;
    }

    .bsb-md-more {
        font-size: 9px;
    }

    /* Modal small */
    .bsb-staff-modal-content {
        width: 95%;
        max-width: 95%;
        border-radius: var(--bsb-radius);
        max-height: 90vh;
    }

    .bsb-staff-modal {
        align-items: center;
        justify-content: center;
    }

    .bsb-staff-modal-header {
        padding: 14px 16px;
    }

    .bsb-staff-modal-header h3 {
        font-size: 16px;
    }

    .bsb-staff-modal-body {
        padding: 14px 16px;
    }

    .bsb-form-group label {
        font-size: 13px;
    }

    .bsb-form-group input,
    .bsb-form-group select,
    .bsb-form-group textarea {
        padding: 10px 12px;
        font-size: 13px;
    }

    .bsb-staff-modal-footer {
        padding: 12px 16px;
    }

    .bsb-confirm-dialog {
        padding: 24px 16px;
    }

    .bsb-confirm-icon {
        font-size: 40px;
    }

    .bsb-confirm-dialog h3 {
        font-size: 17px;
    }

    .bsb-confirm-actions {
        flex-direction: column;
    }

    .bsb-confirm-actions .bsb-btn {
        width: 100%;
        justify-content: center;
    }

    .bsb-week-empty {
        font-size: 10px;
        padding: 8px 0;
    }
}

/* ==========================================
   Responsive - Mobile Full Width
   ========================================== */
@media (max-width: 768px) {
    /* Force body and html to no margin/padding */
    body, html {
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
    }

    /* Target specific WordPress wrappers that often add padding */
    .container, 
    .entry-content, 
    .site-content, 
    .wrapper,
    .wp-block-group,
    .wp-block-group__inner-container,
    .wp-block-column,
    .wp-block-columns {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .bsb-staff-portal {
        padding: 0 !important;
        margin: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .bsb-portal-header {
        border-radius: 0 !important;
        padding: 15px !important;
        margin-bottom: 0 !important;
        width: 100%;
        box-sizing: border-box;
    }
    
    .bsb-portal-stats {
        padding: 10px;
        gap: 8px;
    }
    
    .bsb-portal-controls {
        margin: 10px 0;
        padding: 0 10px;
    }
}

/* ==========================================
   Responsive - Very small phones (360px)
   ========================================== */
@media (max-width: 360px) {
    .bsb-staff-portal {
        padding: 0 !important;
    }

    .bsb-portal-header {
        padding: 12px 10px !important;
    }

    .bsb-portal-info h2 {
        font-size: 15px;
    }

    .bsb-portal-stats {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .bsb-pstat-card {
        flex-direction: row;
        text-align: left;
    }

    .bsb-view-btn {
        padding: 6px 8px;
        font-size: 11px;
    }

    .bsb-date-title {
        font-size: 12px;
    }

    .bsb-time-label {
        width: 40px;
        font-size: 10px;
    }

    /* Hide week view day names on very small screens */
    .bsb-wdh-name {
        font-size: 8px;
    }

    .bsb-wdh-num {
        font-size: 12px;
    }
}

/* ==========================================
   Header Actions & Logout
   ========================================== */
.bsb-portal-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.bsb-btn-logout {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.bsb-btn-logout:hover {
    background: rgba(255,255,255,0.25);
    color: white;
}

.bsb-btn-break {
    background: #f59e0b; /* brighter, visible orange */
    color: #ffffff;
    border: 1px solid #f59e0b;
}

#bsb-staff-save-break {
    background: #f59e0b !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important;
    font-weight: bold !important;
}

#bsb-staff-save-break:hover {
    background: #d97706 !important;
    color: #000000 !important;
    border-color: #000000 !important;
}

/* Break delete button on timeoff badges */
.bsb-break-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.25);
    border: none;
    color: inherit;
    cursor: pointer;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    margin-left: 8px;
    padding: 0;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.bsb-break-delete-btn:hover {
    background: rgba(220, 38, 38, 0.8);
    color: white;
    transform: scale(1.15);
}

/* ==========================================
   Toast Notifications
   ========================================== */
.bsb-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: var(--bsb-radius-sm);
    color: white;
    font-weight: 500;
    font-size: 14px;
    z-index: 10001;
    animation: bsb-toast-in 0.3s ease;
    max-width: 350px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.bsb-toast.success {
    background: var(--bsb-success);
}

.bsb-toast.error {
    background: var(--bsb-danger);
}

.bsb-toast.info {
    background: var(--bsb-info);
}

@keyframes bsb-toast-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bsb-toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}
/* Client Search Results */
.bsb-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--bsb-gray-200);
    border-radius: var(--bsb-radius-sm);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
}
.bsb-search-results.show {
    display: block;
}
.bsb-search-result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--bsb-gray-100);
}
.bsb-search-result-item:last-child {
    border-bottom: none;
}
.bsb-search-result-item:hover {
    background: var(--bsb-gray-50);
}
.bsb-search-result-item .client-name {
    font-weight: 600;
    color: var(--bsb-gray-900);
}
.bsb-search-result-item .client-phone {
    font-size: 13px;
    color: var(--bsb-gray-600);
}
.bsb-search-result-item .client-stats {
    font-size: 11px;
    color: var(--bsb-gray-500);
    margin-top: 2px;
}

/* ==========================================
   Mobile Polish — Overflow + iOS Zoom Fix
   (Loaded last so it wins the cascade)
   ========================================== */

/* Universal containment to keep plugin UI inside the viewport on small screens */
@media (max-width: 768px) {
    .bsb-staff-portal,
    .bsb-staff-login-wrapper,
    .bsb-confirm-wrapper,
    .bsb-rating-wrapper,
    .bsb-staff-modal,
    .bsb-staff-modal-content {
        max-width: 100vw;
        box-sizing: border-box;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    .bsb-staff-portal *,
    .bsb-staff-portal *::before,
    .bsb-staff-portal *::after,
    .bsb-staff-modal *,
    .bsb-staff-modal *::before,
    .bsb-staff-modal *::after,
    .bsb-staff-login-wrapper *,
    .bsb-confirm-wrapper *,
    .bsb-rating-wrapper * {
        box-sizing: border-box;
        max-width: 100%;
    }

    /* Prevent grids/flex rows from pushing content off-screen */
    .bsb-staff-portal img,
    .bsb-staff-modal img,
    .bsb-rating-wrapper img,
    .bsb-confirm-wrapper img {
        max-width: 100%;
        height: auto;
    }

    /* Long words / emails shouldn't overflow cards */
    .bsb-portal-info h2,
    .bsb-portal-info p,
    .bsb-sb-client,
    .bsb-bc-client,
    .bsb-search-result-item .client-name,
    .bsb-search-result-item .client-phone {
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    /* Make any table wrappers scroll horizontally instead of busting layout */
    .bsb-staff-portal table,
    .bsb-staff-modal table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Allow flex rows to wrap so children don't escape their parent */
    .bsb-portal-header,
    .bsb-portal-controls,
    .bsb-portal-header-actions,
    .bsb-bc-actions,
    .bsb-wb-actions,
    .bsb-confirm-actions,
    .bsb-confirm-actions-row {
        flex-wrap: wrap;
    }
}

/*
 * iOS Safari & Android Chrome auto-zoom on focus when an input's font-size
 * is below 16px. Force every interactive form control inside the plugin to
 * 16px on touch-sized viewports so the page never zooms in on tap.
 */
@media (max-width: 768px) {
    .bsb-staff-portal input,
    .bsb-staff-portal select,
    .bsb-staff-portal textarea,
    .bsb-staff-modal input,
    .bsb-staff-modal select,
    .bsb-staff-modal textarea,
    .bsb-staff-login-wrapper input,
    .bsb-staff-login-wrapper select,
    .bsb-staff-login-wrapper textarea,
    .bsb-confirm-wrapper input,
    .bsb-confirm-wrapper select,
    .bsb-confirm-wrapper textarea,
    .bsb-rating-wrapper input,
    .bsb-rating-wrapper select,
    .bsb-rating-wrapper textarea,
    .bsb-form-group input,
    .bsb-form-group select,
    .bsb-form-group textarea {
        font-size: 16px !important;
    }
}

