/* Premium CSS for Cozy Shells Customer Service Portal */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Jost:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: rgba(18, 18, 26, 0.85);
    --bg-card: rgba(26, 26, 38, 0.45);
    --bg-hover: rgba(38, 38, 57, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.4);
    
    --color-text-primary: #f3f4f6;
    --color-text-secondary: #9ca3af;
    --color-text-muted: #6b7280;
    
    --primary: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.15);
    
    --success: #10b981; /* Emerald */
    --success-glow: rgba(16, 185, 129, 0.1);
    
    --warning: #f59e0b; /* Amber */
    --warning-glow: rgba(245, 158, 11, 0.1);
    
    --danger: #ef4444; /* Rose */
    --danger-glow: rgba(239, 68, 68, 0.1);
    
    --sidebar-width: 260px;
    --font-sans: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--color-text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    line-height: 1.5;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.04) 0px, transparent 50%);
    background-attachment: fixed;
}

/* App Layout */
#app-container {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar navigation */
aside {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

aside .brand {
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    height: 80px;
}

aside .brand img {
    max-height: 40px;
    object-fit: contain;
}

.lang-toggle-container {
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.btn-lang {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--color-text-secondary);
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-lang.active, .btn-lang:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

nav {
    padding: 1.5rem 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-group-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    font-weight: 700;
    margin-bottom: 0.25rem;
    margin-top: 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: white;
}

.nav-item.active {
    border-left: 3px solid var(--primary);
    border-radius: 0 12px 12px 0;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-align: center;
}

/* Main Workspace */
main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

header {
    height: 80px;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 15, 0.5);
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

header .subtitle {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

/* Three Column Dashboard Layout */
.cs-dashboard-grid {
    display: grid;
    grid-template-columns: 320px 1fr 360px;
    flex-grow: 1;
    min-height: 0;
    overflow: hidden;
}

/* 1. Left Panel: Inbox */
.cs-inbox-column {
    border-right: 1px solid var(--border-color);
    background: rgba(18, 18, 26, 0.4);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.search-box-container {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: white;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s;
}

.search-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 10px var(--primary-glow);
}

.thread-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.thread-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.thread-item:hover, .thread-item.active {
    background: rgba(255, 255, 255, 0.03);
}

.thread-item.active {
    border-left: 4px solid var(--primary);
}

.thread-item.unread {
    background: rgba(99, 102, 241, 0.03);
}

.thread-item.unread .guest-name {
    font-weight: 700;
    color: #ffffff;
}

.thread-item.unread .thread-preview {
    font-weight: 500;
    color: var(--color-text-primary);
}

.thread-item.unread .thread-meta {
    color: var(--color-text-secondary);
    font-weight: 500;
}

/* Read / Not Unread state (Much lower contrast to make it distinct) */
.thread-item:not(.unread) .guest-name {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
}

.thread-item:not(.unread) .thread-preview {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.3);
}

.thread-item:not(.unread) .thread-meta {
    color: rgba(255, 255, 255, 0.25);
    font-weight: 400;
}

/* Active Open Chat Override (Always highlighted bright) */
.thread-item.active .guest-name {
    font-weight: 700;
    color: #ffffff;
}

.thread-item.active .thread-preview {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
}

.thread-item.active .thread-meta {
    color: rgba(255, 255, 255, 0.6);
}

.thread-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ff5a5f;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255, 90, 95, 0.4);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 90, 95, 0.7);
    }
    70% {
        box-shadow: 0 0 0 5px rgba(255, 90, 95, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 90, 95, 0);
    }
}


.thread-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guest-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
}

.thread-channel-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.channel-airbnb { background: rgba(255, 90, 95, 0.15); color: #ff5a5f; }
.channel-booking { background: rgba(0, 53, 128, 0.3); color: #003580; }
.channel-hostfully { background: rgba(99, 102, 241, 0.15); color: #6366f1; }

.thread-property {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thread-preview {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thread-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

.thread-alert-badge {
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 10px;
    font-weight: 700;
}

/* 2. Middle Panel: Chat Window */
.cs-chat-column {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: rgba(10, 10, 15, 0.2);
}

.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-title-group {
    display: flex;
    flex-direction: column;
}

.chat-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.chat-subtitle {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-bubble {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
}

.message-bubble.incoming {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--color-text-primary);
    border-bottom-left-radius: 4px;
}

.message-bubble.outgoing {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.message-time {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
    text-align: right;
    display: block;
}

.message-bubble.outgoing .message-time {
    color: rgba(255, 255, 255, 0.6);
}

.chat-input-area {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    align-items: center;
    background: rgba(18, 18, 26, 0.4);
}

.chat-textarea {
    width: 100%;
    box-sizing: border-box;
    display: block;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 2.2rem 0.75rem 1rem;
    color: white;
    font-size: 0.88rem;
    font-family: inherit;
    resize: none;
    height: 95px;
    min-height: 65px;
    max-height: 350px;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
}

.chat-textarea:focus {
    border-color: var(--border-focus);
    background: rgba(255, 255, 255, 0.05);
}

.btn-send {
    background: var(--primary);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-send:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* 3. Right Panel: Context Panel */
.cs-context-column {
    background: rgba(18, 18, 26, 0.8);
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
}

.context-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.context-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.guest-info-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.info-label {
    color: var(--color-text-muted);
}

.info-value {
    color: white;
    font-weight: 500;
}

/* Mini Calendar Grid */
.calendar-mini-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: 0.5rem;
}

.calendar-day-header {
    text-align: center;
    font-size: 0.65rem;
    color: var(--color-text-muted);
    font-weight: 700;
}

.calendar-day-cell {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 500;
    position: relative;
}

.calendar-day-cell.checkout {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.45) 50%, rgba(255, 255, 255, 0.03) 50%);
    color: white;
    border-color: rgba(16, 185, 129, 0.5);
}

.calendar-day-cell.checkout.b2b {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.45) 50%, rgba(99, 102, 241, 0.35) 50%);
    border-bottom: 3px solid #ef4444 !important;
}

.calendar-day-cell.checkin {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 50%, rgba(16, 185, 129, 0.45) 50%);
    color: white;
    border-color: rgba(16, 185, 129, 0.5);
}

.calendar-day-cell.checkin.b2b {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.35) 50%, rgba(16, 185, 129, 0.45) 50%);
    border-bottom: 3px solid #ef4444 !important;
}

.calendar-day-cell.stayed {
    background: rgba(16, 185, 129, 0.45);
    color: white;
    border-color: rgba(16, 185, 129, 0.6);
}

.calendar-day-cell.occupied {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.4);
}

.calendar-day-cell.cancelled-stay {
    background: repeating-linear-gradient(45deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.15) 6px, rgba(255, 255, 255, 0.04) 6px, rgba(255, 255, 255, 0.04) 12px) !important;
    color: #f87171 !important;
    border: 1px dashed rgba(239, 68, 68, 0.5) !important;
}

.calendar-day-cell.today {
    border: 1px solid var(--success);
    box-shadow: 0 0 8px var(--success-glow);
}

/* Ficha de Proceso Checklist */
.process-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    padding-left: 1.5rem;
}

.process-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: var(--border-color);
    z-index: 1;
}

.process-step {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    cursor: pointer;
}

.process-step-node {
    position: absolute;
    left: -20px;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--color-text-muted);
    z-index: 2;
    transition: all 0.2s;
}

.process-step.completed .process-step-node {
    background: var(--success);
    border-color: var(--success);
    box-shadow: 0 0 8px var(--success-glow);
}

.process-step.active .process-step-node {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

.process-step-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.process-step.completed .process-step-title,
.process-step.active .process-step-title {
    color: white;
}

.process-step-desc {
    font-size: 0.72rem;
    color: var(--color-text-muted);
}

/* Action Buttons */
.action-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.btn-action {
    width: 100%;
    padding: 0.75rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text-primary);
    transition: all 0.2s;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-action.btn-maint {
    background: rgba(245, 158, 11, 0.08);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.15);
}

.btn-action.btn-maint:hover {
    background: rgba(245, 158, 11, 0.15);
}

.btn-action.btn-clean {
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.15);
}

.btn-action.btn-clean:hover {
    background: rgba(16, 185, 129, 0.15);
}

.btn-action.btn-archive {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-secondary);
}

.btn-action.btn-archive:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.input-control {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 0.8rem;
    color: white;
    font-size: 0.88rem;
    outline: none;
    transition: all 0.2s;
}

.input-control:focus {
    border-color: var(--border-focus);
}

.btn-submit {
    background: var(--primary);
    border: none;
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-submit:hover {
    background: var(--primary-hover);
}

/* Animations */
@keyframes pulse-red {
    0% { background: rgba(239, 68, 68, 0.2); }
    50% { background: rgba(239, 68, 68, 0.5); }
    100% { background: rgba(239, 68, 68, 0.2); }
}

.pulse-red-border {
    animation: pulse-red 2s infinite ease-in-out;
}

/* Horizontal Tabs Styling */
.horizontal-tabs .tab-item {
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-secondary);
}

.horizontal-tabs .tab-item.active {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
    color: #fff !important;
}

.horizontal-tabs .tab-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

/* Auto-Sync Indicator Animations */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

#auto-sync-indicator.paused {
    background: rgba(245, 158, 11, 0.12) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
    color: #f59e0b !important;
}

#auto-sync-indicator.paused #sync-dot {
    background: #f59e0b !important;
    animation: none !important;
}

/* Dropdown Context Menu CS */
.dropdown-menu-cs {
    display: none;
    flex-direction: column;
}

.dropdown-item-cs {
    transition: background-color 0.2s ease;
}

.dropdown-item-cs:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Timeline Calendar Styles */
.timeline-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(18, 18, 26, 0.4);
}

.timeline-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.timeline-table th, .timeline-table td {
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    text-align: center;
    min-width: 50px;
    height: 48px;
    vertical-align: middle;
}

.timeline-table th {
    background: rgba(0, 0, 0, 0.3);
    font-weight: 700;
    color: var(--color-text-secondary);
}

.timeline-table td.timeline-prop-col {
    text-align: left;
    font-weight: 600;
    min-width: 200px;
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: sticky;
    left: 0;
    background: #161622;
    z-index: 5;
    border-right: 2px solid var(--border-color);
}

.timeline-cell-free {
    background: rgba(16, 185, 129, 0.04);
    cursor: pointer;
    transition: background 0.15s ease;
}

.timeline-cell-free:hover {
    background: rgba(16, 185, 129, 0.1);
}

/* Property cards in Calendar Sidebar */
.cal-prop-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cal-prop-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.cal-prop-card.active {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.4);
}

.cal-prop-card img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.cal-prop-card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.cal-prop-card.active .cal-prop-card-title {
    color: #fff;
}

/* Calendar Booking Span highlights */
.timeline-cell-booking {
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    text-align: center;
    vertical-align: middle;
    padding: 0.25rem !important;
    transition: filter 0.15s ease;
}

.timeline-cell-booking:hover {
    filter: brightness(1.2);
}

.timeline-cell-booking.airbnb {
    background: #0ea5e9 !important; /* Sky Blue */
}

.timeline-cell-booking.booking_com {
    background: #2563eb !important; /* Royal Blue */
}

.timeline-cell-booking.vrbo {
    background: #f59e0b !important; /* Amber */
}

.timeline-cell-booking.direct {
    background: #8b5cf6 !important; /* Purple */
}

/* Single Property Month grid styling */
.single-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0px;
    margin-top: 1rem;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.single-calendar-cell {
    aspect-ratio: 1.3;
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    min-height: 75px;
}

.single-calendar-cell:hover {
    background: rgba(255, 255, 255, 0.05);
}

.single-calendar-cell.today {
    box-shadow: inset 0 0 0 2px var(--primary);
}

/* Floating capsule/bar styling for single property monthly grid */
.cal-floating-bar-container {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    height: 30px;
    display: flex;
    align-items: center;
    pointer-events: none; /* Let clicks pass to the cell container */
}

.cal-floating-bar {
    position: absolute;
    height: 28px;
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 2;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0 8px;
    box-sizing: border-box;
    pointer-events: auto; /* Allow clicking the bar itself */
    cursor: pointer;
}

/* Mid-stay stayed day: 100% width */
.cal-floating-bar.stay-bar {
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0;
}

/* Check-in day: right 50% width, rounded left cap */
.cal-floating-bar.checkin-bar {
    left: 50%;
    width: 50%;
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
}

/* Check-out day: left 50% width, rounded right cap */
.cal-floating-bar.checkout-bar {
    left: 0;
    width: 50%;
    border-top-right-radius: 14px;
    border-bottom-right-radius: 14px;
}

/* Channel specific backgrounds for monthly capsules */
.cal-floating-bar.airbnb {
    background: rgba(225, 29, 72, 0.85) !important;
    border: 1px solid rgba(225, 29, 72, 1) !important;
}

.cal-floating-bar.booking {
    background: rgba(37, 99, 235, 0.85) !important;
    border: 1px solid rgba(37, 99, 235, 1) !important;
}

.cal-floating-bar.vrbo {
    background: rgba(245, 158, 11, 0.85) !important;
    border: 1px solid rgba(245, 158, 11, 1) !important;
}

.cal-floating-bar.direct {
    background: rgba(139, 92, 246, 0.85) !important;
    border: 1px solid rgba(139, 92, 246, 1) !important;
}

/* Owner Portal style Gantt Timeline */
.op-timeline-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: rgba(10, 10, 15, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.op-timeline-header-row {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--border-color);
}

.op-timeline-row {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.op-timeline-prop-col {
    width: 220px;
    min-width: 220px;
    padding: 0.85rem 1rem;
    font-weight: 600;
    font-size: 0.78rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    text-align: left;
}

.op-timeline-header-prop {
    font-weight: 700;
    color: var(--color-text-secondary);
    background: rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}

.op-timeline-track-col {
    display: flex;
    position: relative;
    height: 54px;
}

.op-timeline-day-cell {
    width: 50px;
    min-width: 50px;
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.op-timeline-day-cell.weekend {
    background: rgba(255, 255, 255, 0.015);
}

.op-timeline-header-day {
    height: 50px;
    border-right: 1px solid var(--border-color);
    font-family: var(--font-jost);
}

.op-timeline-header-day.weekend {
    background: rgba(255, 255, 255, 0.03);
}

.op-timeline-header-day.today-header {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #fff;
}

.op-timeline-header-day .dow {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    margin-bottom: 2px;
}

.op-timeline-header-day .day-num {
    font-size: 0.85rem;
    font-weight: 700;
}

/* Continuous Booking Bars */
.op-timeline-booking-bar {
    position: absolute;
    top: 9px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-sizing: border-box;
    z-index: 2;
    transition: transform 0.15s ease, filter 0.15s ease;
    border: 1px solid transparent;
}

.op-timeline-booking-bar:hover {
    transform: translateY(-1px);
    filter: brightness(1.2);
}

.op-timeline-booking-bar.airbnb {
    background: rgba(225, 29, 72, 0.45) !important; /* Softer rose/red */
    border: 1px solid rgba(225, 29, 72, 0.7) !important;
}

.op-timeline-booking-bar.booking {
    background: rgba(37, 99, 235, 0.45) !important; /* Softer blue */
    border: 1px solid rgba(37, 99, 235, 0.7) !important;
}

.op-timeline-booking-bar.vrbo {
    background: rgba(245, 158, 11, 0.45) !important; /* Softer amber/yellow */
    border: 1px solid rgba(245, 158, 11, 0.7) !important;
}

.op-timeline-booking-bar.direct {
    background: rgba(139, 92, 246, 0.45) !important; /* Softer purple */
    border: 1px solid rgba(139, 92, 246, 0.7) !important;
}

/* Back-to-back glow animation for monthly calendar cells */
.cal-b2b-glow {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
    animation: cal-b2b-glow-pulse 2s infinite;
}

@keyframes cal-b2b-glow-pulse {
    0% {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
        border-color: rgba(239, 68, 68, 0.5);
    }
    50% {
        box-shadow: 0 0 16px rgba(239, 68, 68, 0.65);
        border-color: rgba(239, 68, 68, 0.9);
    }
    100% {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
        border-color: rgba(239, 68, 68, 0.5);
    }
}

/* Quick Actions Overlay on Sidebar Thread Hover */
.thread-item {
    position: relative;
}

.thread-actions-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to left, #0e0e13 75%, transparent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-right: 1rem;
    padding-left: 2.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateX(10px);
    z-index: 10;
}

.thread-item:hover .thread-actions-overlay {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.btn-thread-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.btn-thread-action:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: scale(1.1);
}

.btn-thread-action.btn-star.active {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.15);
}

.btn-thread-action.btn-archive-toggle.active {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.15);
}

.btn-thread-action.btn-read-toggle {
    font-weight: bold;
}

/* Category Filter Pills in Sidebar */
.thread-filters {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.filter-pill {
    cursor: pointer;
    padding: 0.18rem 0.65rem;
    border-radius: 12px;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
    user-select: none;
}

.filter-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.filter-pill.active {
    background: rgba(99, 102, 241, 0.15) !important;
    color: #6366f1 !important;
    font-weight: 600;
    border: 1px solid rgba(99, 102, 241, 0.25) !important;
}

/* Default desktop hide of mobile bottom nav */
.mobile-bottom-nav {
    display: none;
}

/* ─────────────────────────────────────────────────────────────────────────────
   MOBILE RESPONSIVE OVERRIDES (Media Query max-width: 768px)
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Hide desktop headers to conserve vertical space */
    header {
        padding: 0.75rem 1rem !important;
        height: auto !important;
    }
    
    header h1, header p.subtitle {
        display: none !important;
    }
    
    header .brand img {
        max-height: 26px !important;
    }

    /* Hide horizontal tabs, managed by bottom nav */
    .horizontal-tabs {
        display: none !important;
    }

    /* Bound app container to dynamic viewport height */
    #app-container {
        height: 100vh !important;
        height: 100dvh !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
    }

    /* Adjust main height to leave room for bottom nav */
    main {
        height: calc(100% - 56px) !important;
        flex-grow: 1 !important;
        overflow: hidden !important;
    }

    /* Transition layout columns to flex slide */
    .cs-dashboard-grid {
        display: flex !important;
        width: 200vw !important;
        height: auto !important;
        flex-grow: 1 !important;
        min-height: 0 !important;
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        transform: translateX(0); /* Shows Inbox/Thread list */
    }

    /* Slide to Chat view when thread selected */
    #app-container.show-chat-view .cs-dashboard-grid {
        transform: translateX(-100vw);
    }

    /* Set Columns width to viewport width */
    .cs-inbox-column, .cs-chat-column {
        width: 100vw !important;
        min-width: 100vw !important;
        max-width: 100vw !important;
        height: 100% !important;
        flex-shrink: 0 !important;
    }

    /* Hide the desktop context drawer */
    .cs-context-column {
        display: none !important;
    }

    /* Reveal mobile buttons in header */
    .btn-chat-back, .btn-chat-details-toggle {
        display: inline-flex !important;
    }
    
    .btn-chat-back {
        font-weight: bold;
        color: #6366f1 !important;
        font-size: 1.4rem !important;
        margin-right: 0.5rem;
    }

    header .btn-label-text {
        display: none !important;
    }
    
    header button {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.75rem !important;
    }

    /* Mobile Bottom Navigation Bar Styles */
    .mobile-bottom-nav {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        height: 56px !important;
        flex-shrink: 0 !important;
        background: rgba(10, 10, 15, 0.96);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--border-color);
        display: flex !important;
        flex-direction: row !important;
        padding: 0 !important;
        justify-content: space-around;
        align-items: center;
        z-index: 1000;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        color: var(--color-text-secondary);
        cursor: pointer;
        font-size: 0.72rem;
        flex-grow: 1;
        height: 100%;
        transition: color 0.2s ease;
    }

    .mobile-nav-icon {
        font-size: 1.1rem;
    }

    .mobile-nav-item.active {
        color: #6366f1 !important;
        font-weight: 700;
    }

    /* Bottom Sheet Details Drawer Styles */
    .mobile-details-drawer {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2000;
        display: none;
    }

    .mobile-details-drawer.open {
        display: block;
    }

    .drawer-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(4px);
    }

    .drawer-content {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        background: #0f0f15;
        border-top: 1px solid var(--border-color);
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        max-height: 75vh;
        display: flex;
        flex-direction: column;
        animation: slide-up-drawer 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes slide-up-drawer {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .drawer-handle-bar {
        display: flex;
        justify-content: center;
        padding: 0.6rem 0;
    }

    .drawer-handle {
        width: 40px;
        height: 5px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 3px;
    }

    /* Mobile details custom layout for content inside Bottom Sheet */
    .drawer-body .info-row {
        display: grid;
        grid-template-columns: 100px 1fr;
        gap: 0.5rem;
        padding: 0.4rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.03);
        font-size: 0.8rem;
    }

    .drawer-body .info-label {
        color: var(--color-text-secondary);
    }

    .drawer-body .info-value {
        color: #fff;
        font-weight: 600;
    }

    /* Reposition list views inside Bottom Nav tab switching */
    #tickets-view, #archive-view, #calendar-view {
        width: 100vw !important;
        min-width: 100vw !important;
        max-width: 100vw !important;
    }

    /* Minimized input area on mobile */
    .chat-input-area {
        position: relative;
        background: #09090d !important;
        border-top: 1px solid var(--border-color);
        transition: all 0.25s ease;
        padding: 0.5rem 0.75rem !important;
        height: 60px;
    }

    /* Hide tools row by default on mobile */
    .chat-input-area > div:first-child > div:first-child {
        display: none !important;
    }

    /* Expand input container on focus (when active) */
    .chat-input-area.expanded {
        height: 110px;
    }

    /* Show tools when input expands */
    .chat-input-area.expanded > div:first-child > div:first-child {
        display: flex !important;
    }

    /* Adjust chat textarea height on mobile */
    .chat-textarea {
        height: 36px !important;
        font-size: 0.85rem !important;
    }
    
    .chat-input-area.expanded .chat-textarea {
        height: 48px !important;
    }

    /* Omit resizer on mobile */
    #textarea-resizer {
        display: none !important;
    }
}



