/**
 * Calendar Page Styles - 2 Column Layout
 * Matches Figma design with responsive breakpoints
 * VERSION: 2025-12-19-v5 (Source filter tabs)
 */

/* ============================================
   PAGE LAYOUT - 2 COLUMNS
   ============================================ */

.calendar-page {
    height: calc(100vh - 64px);
    padding: 0;
    overflow: hidden;
    background: #F9FAFB;
}

.calendar-layout {
    display: grid;
    grid-template-columns: 384px 4px 1fr;
    height: 100%;
}

/* Resize Handle */
.calendar-resize-handle {
    width: 4px;
    background: #E5E7EB;
    cursor: col-resize;
    position: relative;
    transition: background 0.15s ease;
}

.calendar-resize-handle:hover,
.calendar-resize-handle.dragging {
    background: #155DFC;
}

.calendar-resize-handle::before {
    content: '';
    position: absolute;
    left: -4px;
    right: -4px;
    top: 0;
    bottom: 0;
}

/* ============================================
   LEFT PANEL - FILTERS & EVENT LIST
   ============================================ */

.calendar-list-panel {
    background: #FFFFFF;
    border-right: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Search */
.calendar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid #E5E7EB;
}

.calendar-search img {
    opacity: 0.5;
    flex-shrink: 0;
}

.calendar-search-input {
    flex: 1;
    border: 1px solid #D1D5DB;
    border-radius: 10px;
    padding: 8px 16px 8px 8px;
    font-size: 14px;
    color: #111827;
    background: transparent;
}

.calendar-search-input:focus {
    outline: none;
    border-color: #155DFC;
}

.calendar-search-input::placeholder {
    color: rgba(10, 10, 10, 0.5);
}

/* Filters Section */
.calendar-filters-section {
    padding: 16px;
    border-bottom: 1px solid #E5E7EB;
}

.calendar-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.calendar-filters-title {
    font-size: 12px;
    font-weight: 500;
    color: #6A7282;
    text-transform: uppercase;
    margin: 0;
}

.calendar-sync-time {
    font-size: 11px;
    color: #9CA3AF;
    font-weight: 400;
}

/* Status Filters */
.calendar-status-filters {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-status-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.calendar-status-btn:hover {
    background: #F3F4F6;
}

.calendar-status-btn.active {
    background: #EFF6FF;
}

.calendar-status-btn.active .calendar-status-label {
    color: #1447E6;
    font-weight: 500;
}

.calendar-status-label {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #364153;
}

.calendar-status-count {
    font-size: 12px;
    font-weight: 500;
    color: #364153;
    background: #E5E7EB;
    padding: 2px 8px;
    border-radius: 9999px;
    min-width: 24px;
    text-align: center;
}

.calendar-status-btn.active .calendar-status-count {
    background: #BEDBFF;
    color: #1447E6;
}

/* Source Filters (All Events / Needs Review) */
.calendar-source-filters {
    display: flex;
    gap: 4px;
    background: #F3F4F6;
    border-radius: 10px;
    padding: 4px;
}

.calendar-source-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    justify-content: center;
}

.calendar-source-btn:hover {
    background: #E5E7EB;
}

.calendar-source-btn.active {
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.calendar-source-label {
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
}

.calendar-source-btn.active .calendar-source-label {
    color: #111827;
}

.calendar-source-badge {
    font-size: 12px;
    font-weight: 600;
    color: #FFFFFF;
    background: #155DFC;
    padding: 2px 8px;
    border-radius: 9999px;
    min-width: 20px;
    text-align: center;
}

.calendar-source-btn:not(.active) .calendar-source-badge {
    background: #6B7280;
}

/* Priority Filters */
.calendar-priority-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.calendar-priority-btn {
    padding: 4px 12px;
    font-size: 14px;
    font-weight: 500;
    text-transform: capitalize;
    border: none;
    border-radius: 10px;
    background: #F3F4F6;
    color: #364153;
    cursor: pointer;
    transition: all 0.15s ease;
}

.calendar-priority-btn:hover {
    background: #E5E7EB;
}

.calendar-priority-btn.active {
    background: #155DFC;
    color: #FFFFFF;
}

/* Event List */
.calendar-item-list {
    flex: 1;
    overflow-y: auto;
}

/* Event Sections */
.calendar-section {
    border-bottom: 1px solid #E5E7EB;
}

.calendar-section:last-child {
    border-bottom: none;
}

.calendar-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
}

.calendar-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-section-count {
    font-size: 12px;
    font-weight: 500;
    color: #9CA3AF;
    background: #E5E7EB;
    padding: 2px 8px;
    border-radius: 10px;
}

.calendar-section-empty {
    padding: 24px 16px;
    text-align: center;
    color: #9CA3AF;
    font-size: 14px;
}

/* Collapsible Section */
.calendar-section-toggle {
    cursor: pointer;
    user-select: none;
}

.calendar-section-toggle:hover {
    background: #F3F4F6;
}

.calendar-section-chevron {
    transition: transform 0.2s ease;
}

.calendar-section-collapsible.expanded .calendar-section-chevron {
    transform: rotate(90deg);
}

/* Personal events have slightly muted styling */
.calendar-section-collapsible .calendar-item {
    opacity: 0.85;
}

.calendar-section-collapsible .calendar-item:hover {
    opacity: 1;
}

/* Event Item */
.calendar-item {
    display: block;
    padding: 16px;
    border-bottom: 1px solid #E5E7EB;
    cursor: pointer;
    transition: background 0.15s ease;
}

.calendar-item:hover {
    background: #F9FAFB;
}

.calendar-item.selected {
    background: #EFF6FF;
}

.calendar-item-header {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.calendar-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.calendar-item-icon.blue {
    background: #DBEAFE;
}

.calendar-item-icon.purple {
    background: #F3E8FF;
}

.calendar-item-icon.green {
    background: #DCFCE7;
}

.calendar-item-icon.orange {
    background: #FFEDD5;
}

.calendar-item-icon img,
.calendar-item-icon svg {
    width: 16px;
    height: 16px;
}

.calendar-item-info {
    flex: 1;
    min-width: 0;
}

.calendar-item-title {
    font-size: 14px;
    font-weight: 600;
    color: #101828;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-item-customer {
    font-size: 13px;
    font-weight: 400;
    color: #6A7282;
    margin: 0;
}

.calendar-item-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}

.calendar-item-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6A7282;
}

.calendar-item-meta-item svg {
    width: 14px;
    height: 14px;
    color: #9CA3AF;
}

.calendar-item-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.calendar-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 8px;
}

.calendar-tag-agent {
    background: #F3F4F6;
    color: #364153;
}

.calendar-tag-agent svg {
    width: 12px;
    height: 12px;
}

.calendar-tag-confidence {
    background: #D1FAE5;
    color: #065F46;
}

.calendar-tag-confidence-low {
    background: #FEF3C7;
    color: #92400E;
}

.calendar-tag-priority-high {
    background: #FEE2E2;
    color: #991B1B;
}

.calendar-tag-priority-medium {
    background: #FEF3C7;
    color: #92400E;
}

.calendar-tag-priority-low {
    background: #D1FAE5;
    color: #065F46;
}

/* ============================================
   RIGHT PANEL - EVENT DETAIL
   ============================================ */

.calendar-detail-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #F9FAFB;
    padding: 24px;
    gap: 16px;
    height: 100%;
    max-height: 100%;
}

/* Event Header Card */
.calendar-header-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 16px 20px;
    flex-shrink: 0;
}

.calendar-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.calendar-header-title-section {
    display: flex;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.calendar-header-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.calendar-header-icon.blue {
    background: #DBEAFE;
}

.calendar-header-icon.purple {
    background: #F3E8FF;
}

.calendar-header-icon.green {
    background: #DCFCE7;
}

.calendar-header-icon.orange {
    background: #FFEDD5;
}

.calendar-header-icon img,
.calendar-header-icon svg {
    width: 24px;
    height: 24px;
}

.calendar-header-info {
    flex: 1;
    min-width: 0;
}

.calendar-detail-title {
    font-size: 18px;
    font-weight: 600;
    color: #101828;
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.calendar-detail-customer {
    font-size: 14px;
    font-weight: 500;
    color: #364153;
    margin: 0;
}

.calendar-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.calendar-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #155DFC;
    color: #FFFFFF;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}

.calendar-action-btn:hover {
    background: #1447E6;
}

.calendar-action-btn:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
}

.calendar-action-btn-secondary {
    background: #F3F4F6;
    color: #364153;
}

.calendar-action-btn-secondary:hover {
    background: #E5E7EB;
}

.calendar-action-btn-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.calendar-action-btn-danger:hover {
    background: #FECACA;
}

.calendar-header-divider {
    height: 1px;
    background: #E5E7EB;
    margin: 12px 0;
}

/* Event Meta Grid */
.calendar-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 12px;
}

.calendar-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.calendar-meta-icon {
    width: 16px;
    height: 16px;
    color: #6A7282;
    flex-shrink: 0;
    margin-top: 2px;
}

.calendar-meta-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.calendar-meta-label {
    font-size: 12px;
    font-weight: 500;
    color: #6A7282;
}

.calendar-meta-value {
    font-size: 14px;
    font-weight: 500;
    color: #101828;
}

/* Payment Status */
.calendar-payment-paid {
    color: #059669;
    font-weight: 600;
}

.calendar-payment-refunded {
    color: #6B7280;
    font-weight: 600;
    font-style: italic;
}

.calendar-payment-pending {
    color: #D97706;
    font-weight: 600;
}

/* Tags Row */
.calendar-tags-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.calendar-detail-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #F3F4F6;
    border-radius: 10px;
    font-size: 13px;
    color: #364153;
}

.calendar-detail-tag svg {
    width: 16px;
    height: 16px;
    color: #6A7282;
}

.calendar-detail-tag-remove {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #9CA3AF;
    display: flex;
    align-items: center;
}

.calendar-detail-tag-remove:hover {
    color: #EF4444;
}

.calendar-add-tag-btn {
    padding: 6px 12px;
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: 500;
    color: #6A7282;
    cursor: pointer;
}

.calendar-add-tag-btn:hover {
    color: #155DFC;
}

/* Detail Content Area */
.calendar-detail-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 16px;
}

/* Cards */
.calendar-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    overflow: hidden;
}

.calendar-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #E5E7EB;
    gap: 12px;
    flex-wrap: wrap;
}

.calendar-card-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.calendar-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #101828;
    margin: 0;
}

.calendar-card-body {
    padding: 16px;
}

.calendar-card-text {
    font-size: 14px;
    line-height: 1.7;
    color: #364153;
    white-space: pre-wrap;
    margin: 0;
}

/* AI Summary Card */
.calendar-ai-card .calendar-card-header {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.05) 0%, rgba(99, 102, 241, 0) 100%);
}

.calendar-confidence-badge {
    font-size: 14px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 9999px;
}

.calendar-confidence-badge.high {
    background: #D1FAE5;
    color: #065F46;
}

.calendar-confidence-badge.medium {
    background: #FEF3C7;
    color: #92400E;
}

.calendar-confidence-badge.low {
    background: #FEE2E2;
    color: #991B1B;
}

/* Notes Section */
.calendar-notes-section {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 12px;
}

.calendar-notes-label {
    font-size: 13px;
    font-weight: 600;
    color: #364153;
    margin: 0 0 4px;
}

.calendar-notes-text {
    font-size: 13px;
    color: #6A7282;
    margin: 0;
}

/* Follow-up Actions */
.calendar-actions-card .calendar-card-header {
    background: #F9FAFB;
}

.calendar-actions-list {
    display: flex;
    flex-direction: column;
}

.calendar-action-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #E5E7EB;
}

.calendar-action-item:last-child {
    border-bottom: none;
}

.calendar-action-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #EFF6FF;
}

.calendar-action-icon svg {
    width: 16px;
    height: 16px;
    color: #155DFC;
}

.calendar-action-info {
    flex: 1;
    min-width: 0;
}

.calendar-action-type {
    font-size: 12px;
    font-weight: 500;
    color: #6A7282;
    text-transform: uppercase;
    padding: 2px 6px;
    background: #F3F4F6;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 4px;
}

.calendar-action-title {
    font-size: 14px;
    font-weight: 600;
    color: #101828;
    margin: 0 0 8px;
}

.calendar-action-preview {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    color: #364153;
    line-height: 1.5;
}

.calendar-action-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.calendar-approve-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: #10B981;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.calendar-approve-btn:hover {
    background: #059669;
}

.calendar-reject-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: #F3F4F6;
    color: #364153;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.calendar-reject-btn:hover {
    background: #E5E7EB;
}

/* Approve All Button */
.calendar-approve-all-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #155DFC;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.calendar-approve-all-btn:hover {
    background: #1447E6;
}

/* Empty State */
.calendar-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #6A7282;
    padding: 40px;
}

.calendar-empty-state svg {
    width: 64px;
    height: 64px;
    color: #D1D5DB;
    margin-bottom: 16px;
}

.calendar-empty-state h3 {
    font-size: 16px;
    color: #374151;
    margin: 0 0 8px 0;
}

.calendar-empty-state p {
    font-size: 14px;
    margin: 0;
}

/* Zero Calendar State */
.calendar-zero-events {
    background: linear-gradient(180deg, #ECFDF5 0%, #F9FAFB 100%);
}

.calendar-zero-events h3 {
    color: #059669;
    font-size: 20px;
    font-weight: 600;
}

.calendar-zero-events p {
    color: #6A7282;
}

.calendar-celebration-icon {
    margin-bottom: 16px;
    animation: celebrate 0.6s ease-out;
}

@keyframes celebrate {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.calendar-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #6A7282;
    font-size: 14px;
    gap: 8px;
}

.calendar-list-empty-icon {
    font-size: 32px;
}

/* Loading State */
.calendar-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6A7282;
}

.calendar-loading .loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #E5E7EB;
    border-top-color: #155DFC;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #FFFFFF;
    border-radius: 10px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: toastSlideIn 0.3s ease;
    max-width: 100%;
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Mobile Navigation */
.calendar-mobile-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: #FFFFFF;
    border-bottom: 1px solid #E5E7EB;
    padding: 12px 16px;
    z-index: 100;
}

.calendar-mobile-back {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #155DFC;
    cursor: pointer;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet - Narrower left panel */
@media (max-width: 1200px) {
    .calendar-layout {
        grid-template-columns: 340px 4px 1fr;
    }
}

/* Tablet Portrait - Stack on selection */
@media (max-width: 1024px) {
    .calendar-layout {
        grid-template-columns: 1fr;
    }

    .calendar-resize-handle {
        display: none;
    }

    .calendar-list-panel {
        max-width: none;
    }

    .calendar-list-panel.hidden {
        display: none;
    }

    .calendar-detail-panel {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        padding-top: 60px;
    }

    .calendar-detail-panel.active {
        display: flex;
    }

    .calendar-mobile-nav {
        display: none;
    }

    .calendar-mobile-nav.active {
        display: block;
    }
}

/* Mobile - Full screen panels */
@media (max-width: 768px) {
    .calendar-page {
        height: calc(100vh - 56px);
    }

    .calendar-filters-section {
        padding: 12px;
    }

    .calendar-priority-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .calendar-priority-btn {
        flex-shrink: 0;
    }

    .calendar-item {
        padding: 12px;
    }

    .calendar-detail-panel {
        padding: 16px;
    }

    .calendar-header-card {
        padding: 16px;
    }

    .calendar-header-top {
        flex-direction: column;
        gap: 16px;
    }

    .calendar-action-btn {
        width: 100%;
        justify-content: center;
    }

    .calendar-tags-row {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .calendar-detail-tag {
        flex-shrink: 0;
    }

    .calendar-meta-grid {
        grid-template-columns: 1fr;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .calendar-status-filters {
        gap: 2px;
    }

    .calendar-status-btn {
        padding: 6px 10px;
    }

    .calendar-item-tags {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .calendar-tag {
        flex-shrink: 0;
    }
}

/* Loading spinner for buttons */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #E5E7EB;
    border-top-color: #155DFC;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   CALENDAR TABS - NEW VIVA CALENDAR v2
   ============================================ */

.calendar-tabs {
    display: flex;
    gap: 4px;
    padding: 0 24px 16px;
    border-bottom: 1px solid #E5E7EB;
    background: #FFFFFF;
    margin: 0 -24px;
    padding-left: 24px;
    padding-right: 24px;
}

.calendar-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.calendar-tab:hover {
    background: #F3F4F6;
    color: #111827;
}

.calendar-tab.active {
    background: #EFF6FF;
    color: #155DFC;
}

.calendar-tab svg {
    flex-shrink: 0;
}

/* Block Time Button */
.calendar-block-time-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-right: 12px;
}

.calendar-block-time-btn:hover {
    border-color: #155DFC;
    color: #155DFC;
    background: #EFF6FF;
}

/* Share Booking Link Button */
.calendar-share-link-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #155DFC;
    border: 1px solid #155DFC;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #FFFFFF;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-right: 8px;
}

.calendar-share-link-btn:hover {
    background: #1249D1;
    border-color: #1249D1;
}

.calendar-share-link-btn svg {
    flex-shrink: 0;
}

/* Tab Contents */
.calendar-tab-contents {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.calendar-tab-content {
    display: none;
    height: 100%;
}

.calendar-tab-content.active {
    display: block;
}

/* ============================================
   AVAILABILITY TAB
   ============================================ */

.availability-container {
    padding: 24px;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    /* Removed height: 100% and overflow-y: auto to prevent double scroll */
}

/* User Selector for multi-user availability */
.availability-user-selector {
    background: linear-gradient(135deg, #F0F5FF 0%, #E0E7FF 100%);
    border: 1px solid #C7D2FE;
    border-radius: 12px;
    padding: 16px 20px;
}

.availability-user-selector-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.availability-user-selector-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #4338CA;
    margin: 0;
    white-space: nowrap;
}

.availability-user-dropdown {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    padding: 10px 14px;
    font-size: 14px;
    color: #111827;
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.availability-user-dropdown:focus {
    outline: none;
    border-color: #4338CA;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.availability-user-hint {
    font-size: 13px;
    color: #6B7280;
    margin: 10px 0 0;
    line-height: 1.5;
}

.availability-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #FFFFFF;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: #4338CA;
}

.availability-user-badge.owner {
    background: #FEF3C7;
    color: #92400E;
}

.availability-user-badge.admin {
    background: #D1FAE5;
    color: #065F46;
}

/* Empty state for user availability */
.availability-empty-state {
    text-align: center;
    padding: 24px;
    background: #F9FAFB;
    border: 1px dashed #D1D5DB;
    border-radius: 8px;
    margin-bottom: 20px;
}

.availability-empty-state svg {
    margin-bottom: 12px;
}

.availability-empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px;
}

.availability-empty-state p {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
    max-width: 400px;
    margin: 0 auto;
}

.availability-section {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 24px;
    font-family: var(--ai-font, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
}

.availability-section-header {
    margin-bottom: 20px;
}

.availability-section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px;
}

.availability-section-header p {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
}

.availability-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #155DFC;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 12px;
    transition: background 0.15s;
}

.availability-add-btn:hover {
    background: #1447E6;
}

.availability-save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: #155DFC;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.15s;
}

.availability-save-btn:hover {
    background: #1447E6;
}

/* Weekly Hours */
.availability-hours {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.availability-day-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: #F9FAFB;
    border-radius: 8px;
}

.availability-day-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
}

.availability-day-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #155DFC;
}

.availability-day-name {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

.availability-day-times {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.availability-day-times input[type="time"] {
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 14px;
    color: #111827;
}

.availability-day-times span {
    color: #6B7280;
    font-size: 14px;
}

.availability-day-closed {
    color: #9CA3AF;
    font-size: 14px;
    font-style: italic;
}

/* Blocked Times List */
.blocked-times-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blocked-time-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 8px;
}

.blocked-time-icon {
    width: 32px;
    height: 32px;
    background: #FEE2E2;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #EF4444;
}

.blocked-time-icon svg {
    width: 16px;
    height: 16px;
}

.blocked-time-info {
    flex: 1;
}

.blocked-time-title {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin: 0 0 4px;
}

.blocked-time-dates {
    font-size: 13px;
    color: #6B7280;
}

.blocked-time-recurrence {
    font-size: 12px;
    color: #9CA3AF;
    background: #F3F4F6;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.blocked-time-delete {
    background: none;
    border: none;
    padding: 4px;
    color: #EF4444;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.blocked-time-delete:hover {
    opacity: 1;
}

.blocked-times-empty {
    text-align: center;
    padding: 32px;
    color: #9CA3AF;
    font-size: 14px;
}

.availability-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #6B7280;
}

.availability-empty {
    color: #6B7280;
    font-size: 14px;
    font-style: italic;
    padding: 16px 0;
}

/* Booking Settings Grid */
.booking-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.booking-setting-card {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 16px;
}

.booking-setting-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
    font-family: var(--ai-font, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
}

.booking-setting-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-family: var(--ai-font, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    color: #111827;
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.booking-setting-select:focus {
    outline: none;
    border-color: #155DFC;
    box-shadow: 0 0 0 3px rgba(21, 93, 252, 0.15);
}

.booking-setting-hint {
    font-size: 12px;
    color: #6B7280;
    margin-top: 8px;
    font-family: var(--ai-font, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
}

/* Time inputs in availability */
.availability-time-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.availability-time-input {
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--ai-font, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    color: #111827;
}

.availability-time-input:focus {
    outline: none;
    border-color: #155DFC;
    box-shadow: 0 0 0 3px rgba(21, 93, 252, 0.15);
}

.availability-time-separator {
    color: #6B7280;
    font-size: 14px;
}

/* ============================================
   APPOINTMENT TYPES TAB
   ============================================ */

.appointment-types-container {
    padding: 24px;
    max-width: 900px;
    height: 100%;
    overflow-y: auto;
}

.appointment-types-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.appointment-types-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px;
}

.appointment-types-header p {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
}

.appointment-types-add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #155DFC;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.appointment-types-add-btn:hover {
    background: #1447E6;
}

.appointment-types-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.appointment-type-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    transition: box-shadow 0.15s;
}

.appointment-type-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.appointment-type-card.inactive {
    opacity: 0.6;
}

.appointment-type-color {
    width: 8px;
    height: 48px;
    border-radius: 4px;
    flex-shrink: 0;
}

.appointment-type-info {
    flex: 1;
    min-width: 0;
}

.appointment-type-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px;
}

.appointment-type-description {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appointment-type-meta {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.appointment-type-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #374151;
}

.appointment-type-meta-item svg {
    width: 16px;
    height: 16px;
    color: #9CA3AF;
}

.appointment-type-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.appointment-type-edit,
.appointment-type-delete {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: #6B7280;
    transition: all 0.15s;
}

.appointment-type-edit:hover {
    background: #EFF6FF;
    color: #155DFC;
}

.appointment-type-delete:hover {
    background: #FEE2E2;
    color: #EF4444;
}

.appointment-types-empty {
    text-align: center;
    padding: 60px 24px;
    background: #F9FAFB;
    border-radius: 12px;
    border: 2px dashed #E5E7EB;
}

.appointment-types-empty svg {
    width: 48px;
    height: 48px;
    color: #D1D5DB;
    margin-bottom: 16px;
}

.appointment-types-empty h3 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px;
}

.appointment-types-empty p {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
}

/* ============================================
   BOOKING PAGE TAB
   ============================================ */

.booking-page-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    padding: 24px;
    height: 100%;
    overflow: hidden;
}

.booking-page-preview-section {
    overflow-y: auto;
    padding-right: 8px;
}

.booking-page-header {
    margin-bottom: 24px;
}

.booking-page-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px;
}

.booking-page-header p {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
}

.booking-page-url-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.booking-page-url-label {
    font-size: 13px;
    font-weight: 500;
    color: #6B7280;
    margin-bottom: 8px;
}

.booking-page-url-row {
    display: flex;
    gap: 8px;
}

.booking-page-url-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: #F9FAFB;
}

.booking-page-copy-btn,
.booking-page-open-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    cursor: pointer;
    color: #6B7280;
    transition: all 0.15s;
    text-decoration: none;
}

.booking-page-copy-btn:hover,
.booking-page-open-btn:hover {
    border-color: #155DFC;
    color: #155DFC;
    background: #EFF6FF;
}

.booking-page-settings-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 20px;
}

.booking-page-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #E5E7EB;
}

.booking-page-setting-row:first-child {
    padding-top: 0;
}

.booking-page-setting-info {
    flex: 1;
}

.booking-page-setting-label {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    display: block;
    margin-bottom: 4px;
}

.booking-page-setting-desc {
    font-size: 13px;
    color: #6B7280;
    display: block;
}

.booking-page-setting-group {
    padding: 16px 0;
    border-bottom: 1px solid #E5E7EB;
}

.booking-page-setting-group:last-of-type {
    border-bottom: none;
}

.booking-page-input,
.booking-page-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    margin-top: 8px;
    font-family: inherit;
}

.booking-page-input:focus,
.booking-page-textarea:focus {
    outline: none;
    border-color: #155DFC;
    box-shadow: 0 0 0 3px rgba(21, 93, 252, 0.1);
}

.booking-page-color-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.booking-page-color-picker input[type="color"] {
    width: 40px;
    height: 40px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}

.booking-page-color-value {
    font-size: 14px;
    color: #6B7280;
    font-family: monospace;
}

.booking-page-save-btn {
    width: 100%;
    padding: 12px 20px;
    background: #155DFC;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.15s;
}

.booking-page-save-btn:hover {
    background: #1447E6;
}

/* Preview */
.booking-page-preview {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.booking-page-preview-header {
    padding: 12px 16px;
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
    font-size: 13px;
    font-weight: 500;
    color: #6B7280;
}

.booking-page-preview-frame {
    flex: 1;
    min-height: 400px;
}

.booking-page-preview-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ============================================
   MODALS
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-dialog {
    background: #FFFFFF;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #9CA3AF;
    transition: color 0.15s;
}

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

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-form-group {
    margin-bottom: 16px;
}

.modal-form-group:last-child {
    margin-bottom: 0;
}

.modal-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.modal-form-group input[type="text"],
.modal-form-group input[type="number"],
.modal-form-group input[type="date"],
.modal-form-group input[type="time"],
.modal-form-group select,
.modal-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    font-family: inherit;
}

.modal-form-group input:focus,
.modal-form-group select:focus,
.modal-form-group textarea:focus {
    outline: none;
    border-color: #155DFC;
    box-shadow: 0 0 0 3px rgba(21, 93, 252, 0.1);
}

.modal-form-hint {
    margin-top: 6px;
    font-size: 12px;
    color: #6B7280;
}

.modal-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Price input with currency prefix */
.price-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.price-input-wrapper .price-currency {
    position: absolute;
    left: 14px;
    color: #6B7280;
    font-size: 14px;
    pointer-events: none;
}

.price-input-wrapper input {
    padding-left: 28px !important;
}

.modal-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.modal-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #155DFC;
}

.modal-checkbox-label span {
    font-size: 14px;
    color: #374151;
}

/* Manual time toggle - smaller, secondary styling */
.manual-time-toggle {
    margin-top: 12px;
    padding: 10px 12px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
}

.manual-time-toggle span {
    font-size: 13px;
    color: #6B7280;
}

.manual-time-toggle + .modal-form-hint {
    margin-top: 8px;
    margin-left: 12px;
    font-size: 11px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #E5E7EB;
    justify-content: flex-end;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.modal-btn-primary {
    background: #155DFC;
    color: #FFFFFF;
    border: none;
}

.modal-btn-primary:hover {
    background: #1447E6;
}

.modal-btn-secondary {
    background: #FFFFFF;
    color: #374151;
    border: 1px solid #D1D5DB;
}

.modal-btn-secondary:hover {
    background: #F9FAFB;
}

/* Appointment Type Color Picker */
.appointment-type-colors {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #111827;
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #111827;
}

/* Share Booking Link Modal */
.modal-description {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 20px;
    line-height: 1.5;
}

.share-link-preview {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.share-link-preview input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    background: #F9FAFB;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}

.share-link-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    background: #155DFC;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.share-link-copy-btn:hover {
    background: #1249D1;
}

.share-link-success {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 13px;
    color: #059669;
    font-weight: 500;
}

.modal-btn-primary:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
}

.modal-btn-primary:disabled:hover {
    background: #9CA3AF;
}

.modal-btn-primary svg {
    margin-right: 6px;
    vertical-align: middle;
}

/* Responsive adjustments for tabs */
@media (max-width: 1024px) {
    .calendar-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 12px;
        margin-bottom: -12px;
    }

    .calendar-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .booking-page-container {
        grid-template-columns: 1fr;
    }

    .booking-page-preview {
        display: none;
    }
}

@media (max-width: 768px) {
    .calendar-tabs {
        padding: 0 16px 16px;
    }

    .calendar-tab {
        padding: 8px 12px;
        font-size: 13px;
    }

    .calendar-block-time-btn,
    .calendar-share-link-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .calendar-share-link-btn span {
        display: none;
    }

    .availability-container,
    .appointment-types-container {
        padding: 16px;
    }

    .booking-page-container {
        padding: 16px;
    }

    .availability-day-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .availability-day-times {
        flex-wrap: wrap;
    }

    .appointment-type-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .appointment-type-meta {
        width: 100%;
        justify-content: space-between;
    }

    .appointment-types-header {
        flex-direction: column;
        gap: 16px;
    }

    .appointment-types-add-btn {
        width: 100%;
        justify-content: center;
    }

    .modal-form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   VIEW TOGGLE (List/Calendar)
   ============================================ */

.calendar-view-toggle {
    display: flex;
    background: #F3F4F6;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.calendar-view-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.calendar-view-btn:hover {
    color: #374151;
    background: rgba(255, 255, 255, 0.5);
}

.calendar-view-btn.active {
    background: #FFFFFF;
    color: #155DFC;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.calendar-view-btn svg {
    flex-shrink: 0;
}

/* View Content Containers */
.calendar-view-content {
    display: none;
    height: 100%;
}

.calendar-view-content.active {
    display: flex;
}

/* ============================================
   CALENDAR GRID VIEW
   ============================================ */

#calendarViewContent {
    display: none;
    gap: 0;
}

#calendarViewContent.active {
    display: flex;
}

.calendar-grid-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #FFFFFF;
    border-right: 1px solid #E5E7EB;
}

/* Calendar Header with Navigation */
.calendar-grid-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
    background: #FFFFFF;
}

.calendar-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.calendar-nav-btn:hover {
    border-color: #155DFC;
    color: #155DFC;
    background: #EFF6FF;
}

.calendar-grid-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    min-width: 180px;
    text-align: center;
}

.calendar-today-btn {
    padding: 8px 16px;
    background: #EFF6FF;
    border: 1px solid #155DFC;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #155DFC;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: auto;
}

.calendar-today-btn:hover {
    background: #155DFC;
    color: #FFFFFF;
}

/* Day Headers */
.calendar-grid-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #E5E7EB;
    background: #F9FAFB;
}

.calendar-day-header {
    padding: 12px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Calendar Grid */
.calendar-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: minmax(100px, 1fr);
    overflow-y: auto;
}

.calendar-grid-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6B7280;
}

/* Calendar Day Cell */
.calendar-day-cell {
    border-right: 1px solid #E5E7EB;
    border-bottom: 1px solid #E5E7EB;
    padding: 8px;
    min-height: 100px;
    background: #FFFFFF;
    transition: background 0.15s ease;
    overflow: hidden;
}

.calendar-day-cell:nth-child(7n) {
    border-right: none;
}

.calendar-day-cell:hover {
    background: #F9FAFB;
}

.calendar-day-cell.other-month {
    background: #F9FAFB;
}

.calendar-day-cell.other-month .calendar-day-number {
    color: #9CA3AF;
}

.calendar-day-cell.today {
    background: #EFF6FF;
}

.calendar-day-cell.today .calendar-day-number {
    background: #155DFC;
    color: #FFFFFF;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day-number {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

/* Events in Calendar Cells */
.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-day-event {
    padding: 4px 6px;
    background: #155DFC;
    color: #FFFFFF;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-day-event:hover {
    opacity: 0.9;
}

.calendar-day-event.confirmed {
    background: #10B981;
}

.calendar-day-event.pending {
    background: #F59E0B;
}

.calendar-day-event.cancelled {
    background: #EF4444;
    opacity: 0.7;
    text-decoration: line-through;
}

.calendar-day-more {
    font-size: 11px;
    color: #6B7280;
    font-weight: 500;
    padding: 2px 6px;
    cursor: pointer;
}

.calendar-day-more:hover {
    color: #155DFC;
}

/* Calendar Detail Sidebar */
.calendar-grid-detail {
    width: 360px;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.calendar-grid-detail-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #9CA3AF;
}

.calendar-grid-detail-empty p {
    margin-top: 16px;
    font-size: 14px;
}

/* Responsive for View Toggle */
@media (max-width: 1024px) {
    .calendar-view-toggle {
        order: -1;
        margin-right: auto;
    }

    .calendar-view-btn span {
        display: none;
    }

    .calendar-view-btn {
        padding: 8px 12px;
    }

    .calendar-grid-detail {
        display: none;
    }

    #calendarViewContent {
        flex-direction: column;
    }

    .calendar-grid-container {
        border-right: none;
    }
}

@media (max-width: 768px) {
    .calendar-grid-title {
        font-size: 16px;
        min-width: 140px;
    }

    .calendar-day-cell {
        min-height: 80px;
        padding: 4px;
    }

    .calendar-day-number {
        font-size: 12px;
    }

    .calendar-day-event {
        font-size: 10px;
        padding: 2px 4px;
    }
}

/* ============================================
   DAY DETAIL SIDEBAR VIEW
   ============================================ */

.calendar-day-cell.has-events {
    cursor: pointer;
}

.day-detail-header {
    padding: 20px;
    border-bottom: 1px solid #E5E7EB;
    background: #F9FAFB;
}

.day-detail-date {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.day-detail-day-name {
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
}

.day-detail-full-date {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.day-detail-today-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    background: #155DFC;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 500;
    border-radius: 9999px;
}

.day-detail-count {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.day-detail-count-number {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

.day-detail-count-label {
    font-size: 14px;
    color: #6B7280;
}

.day-detail-slots {
    flex: 1;
    overflow-y: auto;
}

.day-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #9CA3AF;
}

.day-detail-empty p {
    margin-top: 16px;
    font-size: 14px;
    color: #6B7280;
}

.day-detail-slot {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #E5E7EB;
    cursor: pointer;
    transition: background 0.15s ease;
}

.day-detail-slot:hover {
    background: #F9FAFB;
}

.day-detail-slot:last-child {
    border-bottom: none;
}

.day-detail-slot-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 60px;
    flex-shrink: 0;
}

.day-detail-time-start {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.day-detail-time-duration {
    font-size: 11px;
    color: #9CA3AF;
}

.day-detail-slot-indicator {
    width: 4px;
    align-self: stretch;
    border-radius: 2px;
    flex-shrink: 0;
    background: #155DFC;
}

.day-detail-slot-indicator.confirmed {
    background: #10B981;
}

.day-detail-slot-indicator.pending {
    background: #F59E0B;
}

.day-detail-slot-indicator.cancelled {
    background: #EF4444;
}

.day-detail-slot-content {
    flex: 1;
    min-width: 0;
}

.day-detail-slot-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-detail-slot-customer {
    font-size: 13px;
    color: #6B7280;
    margin: 0 0 8px 0;
}

.day-detail-slot-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.day-detail-slot-phone {
    font-size: 12px;
    color: #9CA3AF;
}

.day-detail-slot-arrow {
    display: flex;
    align-items: center;
    color: #D1D5DB;
    flex-shrink: 0;
}

.day-detail-slot:hover .day-detail-slot-arrow {
    color: #6B7280;
}
