/* GoStayo — CSS with Sidebar Layout */

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

:root {
    --bg: #f3f4f8;
    --surface: #ffffff;
    --surface2: #f0f0f5;
    --accent: #e94560;
    --accent2: #fce4e8;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --green: #16a34a;
    --blue: #3b82f6;
    --yellow: #d97706;
    --border: #e5e7eb;
    --radius: 14px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --sidebar-w: 240px;
    --mobile-nav-h: 56px;
    --mobile-header-h: 52px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.hidden { display: none !important; }

/* ========== LOGIN SCREEN ========== */
.screen { height: 100vh; height: 100dvh; }

#login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8f0 50%, #dfe1ec 100%);
}

.login-box {
    text-align: center;
    padding: 40px 24px;
    max-width: 380px;
}

.logo {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #ff6b8a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.tagline {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.sub {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 32px;
}

.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn:active { transform: scale(0.97); }

.btn-google {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.3);
}

.btn-google:hover {
    box-shadow: 0 6px 28px rgba(233, 69, 96, 0.45);
}

.btn-accent {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.2);
}

.btn-accent:hover {
    box-shadow: 0 4px 16px rgba(233, 69, 96, 0.3);
}

/* ========== APP SCREEN (sidebar + main) ========== */
#app-screen {
    display: flex;
    height: 100vh;
    height: 100dvh;
}

/* ========== SIDEBAR ========== */
#sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100%;
    z-index: 50;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 20px 20px 12px;
}

.logo-sm {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.sidebar-property {
    padding: 0 16px 16px;
}

.sidebar-property .property-select {
    width: 100%;
}

.property-select {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.property-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 10px;
    text-align: left;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--surface2);
    color: var(--text);
}

.nav-item.active {
    background: var(--accent2);
    color: var(--accent);
    font-weight: 600;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.sidebar-bottom {
    padding: 12px 10px 16px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.sidebar-bottom .nav-settings {
    margin-bottom: 8px;
}

.sidebar-user {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    gap: 8px;
}

.sidebar-user #user-name {
    font-size: 13px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.sidebar-logout {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.15s;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.sidebar-logout:hover {
    color: var(--accent);
}

/* SIDEBAR OVERLAY (mobile) */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 40;
}

/* ========== MOBILE HEADER ========== */
#mobile-header {
    display: none; /* shown on mobile via media query */
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    height: var(--mobile-header-h);
    z-index: 10;
}

#mobile-header .logo-sm {
    font-size: 18px;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.15s;
}

.btn-icon:hover {
    background: var(--surface2);
    color: var(--text);
}

/* ========== MAIN CONTENT ========== */
#main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ========== APP VIEWS ========== */
.app-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.view-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    -webkit-overflow-scrolling: touch;
}

.view-header {
    margin-bottom: 20px;
}

.view-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

/* ========== MOBILE BOTTOM NAV ========== */
#mobile-nav {
    display: none; /* shown on mobile via media query */
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    height: var(--mobile-nav-h);
    padding: 4px 0;
}

.mob-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.15s;
}

.mob-nav-btn.active {
    color: var(--accent);
}

.mob-nav-icon {
    width: 20px;
    height: 20px;
}

/* ========== CHAT ========== */
#chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scroll-behavior: smooth;
}

#messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 700px;
    margin: 0 auto;
}

.msg {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.5;
    max-width: 85%;
    word-wrap: break-word;
    white-space: pre-wrap;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-user {
    background: var(--accent);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.msg-bot {
    background: var(--surface);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}

/* Loading dots */
.msg-loading {
    display: flex;
    gap: 4px;
    padding: 16px 20px;
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.2s infinite ease-in-out;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* TEMPLATES BAR */
#templates-bar {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    overflow-x: auto;
    flex-shrink: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    -webkit-overflow-scrolling: touch;
}

#templates-bar::-webkit-scrollbar { display: none; }

.tmpl-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.tmpl-btn:hover {
    background: var(--accent2);
    border-color: var(--accent);
    color: var(--accent);
}

.tmpl-btn:active {
    background: var(--accent);
    color: white;
}

/* INPUT AREA */
#input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

#msg-input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s;
}

#msg-input:focus {
    border-color: var(--accent);
}

#msg-input::placeholder {
    color: #9ca3af;
}

#btn-send {
    padding: 12px 20px;
    border-radius: 24px;
    border: none;
    background: var(--accent);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s;
}

#btn-send:active {
    transform: scale(0.95);
}

/* ========== DASHBOARD SECTIONS ========== */
.dash-section {
    margin-bottom: 20px;
    animation: fadeIn 0.25s ease;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.dash-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.dash-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.dash-title-row .dash-title {
    margin-bottom: 0;
}

/* Today Grid */
.today-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.today-card {
    background: var(--bg);
    border-radius: 10px;
    padding: 16px 8px;
    text-align: center;
    border: 1px solid var(--border);
    transition: transform 0.15s, box-shadow 0.15s;
}

.today-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.today-num {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 2px;
}

.today-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Cleaning List */
#cleaning-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cleaning-item {
    background: var(--bg);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    border-left: 3px solid var(--yellow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cleaning-item.urgent {
    border-left-color: var(--accent);
}

.cleaning-urgency {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    text-transform: uppercase;
}

.cleaning-urgency.urgent {
    background: rgba(233, 69, 96, 0.1);
    color: var(--accent);
}

.cleaning-urgency.normal {
    background: rgba(217, 119, 6, 0.1);
    color: var(--yellow);
}

/* Guest Messages */
.msg-card {
    background: var(--bg);
    border-radius: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    margin-bottom: 8px;
    animation: fadeIn 0.2s ease;
}

.msg-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.msg-guest {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.msg-date {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.msg-subject {
    font-size: 13px;
    color: var(--text);
    margin-bottom: 4px;
}

.msg-snippet {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-reply {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-reply:hover {
    background: var(--accent);
    color: white;
}

.btn-reply:active {
    transform: scale(0.97);
}

/* Booking Cards */
.booking-card {
    background: var(--bg);
    border-radius: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    margin-bottom: 8px;
    animation: fadeIn 0.2s ease;
}

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

.booking-guest {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.booking-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 8px;
    text-transform: uppercase;
}

.booking-badge.checking_in {
    background: rgba(22, 163, 74, 0.1);
    color: var(--green);
}

.booking-badge.in_progress {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.booking-badge.upcoming {
    background: rgba(217, 119, 6, 0.1);
    color: var(--yellow);
}

.booking-dates {
    display: flex;
    gap: 16px;
    font-size: 13px;
}

.booking-date-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.booking-date-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.booking-date-val {
    font-weight: 600;
    color: var(--text);
}

.booking-phone {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
}
.booking-phone-icon { margin-right: 4px; }
.btn-link-phone {
    background: none;
    border: 1px dashed var(--border);
    border-radius: 6px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    cursor: pointer;
}
.btn-link-phone:hover {
    background: rgba(59,130,246,0.06);
    border-color: var(--blue);
}

/* Pricing Card */
.pricing-card {
    background: var(--bg);
    border-radius: 10px;
    padding: 16px;
    border: 1px solid var(--border);
}

.pricing-action {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.pricing-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.pricing-icon.increase { background: rgba(22, 163, 74, 0.1); }
.pricing-icon.decrease { background: rgba(233, 69, 96, 0.1); }
.pricing-icon.hold { background: rgba(59, 130, 246, 0.1); }

.pricing-label {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.pricing-label.increase { color: var(--green); }
.pricing-label.decrease { color: var(--accent); }
.pricing-label.hold { color: #2563eb; }

.pricing-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 12px;
}

.pricing-stats {
    display: flex;
    gap: 16px;
}

.pricing-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pricing-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.pricing-stat-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
}

/* Alert Cards */
.alert-card {
    background: var(--bg);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: fadeIn 0.2s ease;
}

.alert-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.alert-icon.high { background: rgba(233, 69, 96, 0.1); }
.alert-icon.medium { background: rgba(217, 119, 6, 0.1); }
.alert-icon.low { background: rgba(59, 130, 246, 0.1); }

.alert-body { flex: 1; }

.alert-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
}

.alert-title.high { color: var(--accent); }
.alert-title.medium { color: var(--yellow); }
.alert-title.low { color: #2563eb; }

.alert-msg {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Setup Card */
.setup-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    border: 1px dashed var(--border);
}

.setup-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.setup-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.setup-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Toggle Switch */
.auto-reply-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.toggle-label.active {
    color: var(--green);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border);
    border-radius: 24px;
    transition: background 0.2s;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--green);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Pending Reply Cards */
.pending-card {
    background: var(--bg);
    border-radius: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--yellow);
    margin-bottom: 8px;
    animation: fadeIn 0.2s ease;
}

.pending-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.pending-guest {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.pending-time {
    font-size: 11px;
    color: var(--text-muted);
}

.pending-snippet {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.4;
}

.pending-draft {
    font-size: 13px;
    color: var(--text);
    background: var(--bg);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    line-height: 1.5;
    border: 1px solid var(--border);
}

.pending-actions {
    display: flex;
    gap: 8px;
}

.btn-approve {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: var(--green);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.btn-approve:hover { opacity: 0.9; }

.btn-reject {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-reject:hover {
    background: rgba(233, 69, 96, 0.1);
    color: var(--accent);
    border-color: var(--accent);
}

.pending-channel {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(22, 163, 74, 0.1);
    color: var(--green);
    text-transform: uppercase;
}

/* Scheduled Message Cards */
.sched-card {
    background: var(--bg);
    border-radius: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--blue);
    margin-bottom: 8px;
    animation: fadeIn 0.2s ease;
}

.sched-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.sched-guest {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.sched-type {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
    text-transform: uppercase;
}

.sched-body {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 8px;
}

.sched-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sched-time {
    font-size: 11px;
    color: var(--text-muted);
}

.sched-status {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    text-transform: uppercase;
}

.sched-status.pending {
    background: rgba(234, 179, 8, 0.1);
    color: var(--yellow);
}

.sched-status.ready {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
}

.sched-status.sent {
    background: rgba(22, 163, 74, 0.1);
    color: var(--green);
}

.sched-status.failed {
    background: rgba(233, 69, 96, 0.1);
    color: var(--accent);
}

.sched-status.skipped {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-muted);
}

/* Template Editor Cards */
.template-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 14px;
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.template-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.toggle-sm {
    transform: scale(0.8);
    transform-origin: right center;
}

.template-card textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    background: var(--surface);
    color: var(--text);
}

.template-card textarea:focus {
    outline: none;
    border-color: var(--blue);
}

/* Settings description */
.settings-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 14px;
}
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0;
}
.settings-row label {
    margin: 0;
}

/* Property management in settings */
.property-card {
    background: var(--surface2);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.property-card-info {
    flex: 1;
}
.property-card-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}
.property-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.property-card-actions {
    display: flex;
    gap: 6px;
}
.property-card-actions button {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
}
.property-card-actions button:hover {
    background: var(--surface2);
    color: var(--text);
}
.property-card-actions .btn-delete-prop {
    color: var(--accent);
    border-color: var(--accent);
}
.property-card-actions .btn-delete-prop:hover {
    background: rgba(233, 69, 96, 0.08);
}
.property-form {
    background: var(--surface2);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
}
.property-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}
.property-form-actions .btn-save {
    width: auto;
    margin-top: 0;
    padding: 8px 20px;
}
.settings-property-badge {
    display: inline-block;
    background: var(--accent2);
    color: var(--accent);
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
}
.property-badge {
    display: inline-block;
    background: var(--accent2);
    color: var(--accent);
    padding: 1px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
}

/* Test mode section */
.test-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}
.test-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}
.seed-summary {
    font-size: 13px;
    color: var(--text);
    background: var(--surface2);
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
}
.seed-scenarios {
    font-size: 12px;
    color: var(--text-muted);
}
.seed-row {
    padding: 4px 0;
}
.seed-tag {
    display: inline-block;
    background: var(--accent2);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
}

/* Small Button */
.btn-sm {
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-sm:hover {
    background: var(--accent2);
    color: var(--accent);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 20px 16px;
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    opacity: 0.8;
}

/* ========== MODAL ========== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.15s ease;
}

.modal-content {
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.1);
}

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

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.settings-group {
    margin-bottom: 16px;
}

.settings-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
}

.settings-group label,
#rules-form label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    margin-top: 14px;
}

.settings-group input,
.settings-group textarea,
#rules-form input,
#rules-form textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

#rules-form textarea,
.settings-group textarea {
    resize: vertical;
    min-height: 60px;
}

.settings-group input:focus,
.settings-group textarea:focus,
#rules-form input:focus,
#rules-form textarea:focus {
    border-color: var(--accent);
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

.btn-save {
    width: 100%;
    margin-top: 20px;
    background: var(--green);
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.2);
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-save:hover {
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.3);
}

.btn-save:active {
    transform: scale(0.97);
}

/* ========== ISSUES ========== */

.issue-counts {
    display: flex;
    gap: 6px;
}

.count-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: white;
}

.count-badge.urgent { background: var(--accent); }
.count-badge.high { background: var(--yellow); }
.count-badge.normal { background: var(--blue); }
.count-badge.low { background: #9ca3af; }

.issue-card {
    background: var(--bg);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.issue-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.issue-title {
    font-weight: 600;
    font-size: 14px;
}

.issue-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.issue-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.urgency-badge, .status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.urgency-badge.urgent { background: #fce4e8; color: var(--accent); }
.urgency-badge.high { background: #fef3c7; color: var(--yellow); }
.urgency-badge.normal { background: #dbeafe; color: var(--blue); }
.urgency-badge.low { background: #f3f4f6; color: #6b7280; }

.status-badge.open { background: #fce4e8; color: var(--accent); }
.status-badge.in_progress { background: #fef3c7; color: var(--yellow); }
.status-badge.resolved { background: #dcfce7; color: var(--green); }

/* Cleaning task statuses */
.status-badge.pending { background: #f3f4f6; color: #6b7280; }
.status-badge.notified { background: #dbeafe; color: var(--blue); }
.status-badge.confirmed { background: #dcfce7; color: var(--green); }
.status-badge.skipped { background: #f3f4f6; color: #9ca3af; }

.issue-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.issue-actions button {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-weight: 600;
}

.issue-actions button:hover {
    background: var(--surface2);
}

.issue-actions .btn-resolve {
    background: var(--green);
    color: white;
    border-color: var(--green);
}

.issue-actions .btn-resolve:hover {
    opacity: 0.9;
}

.issue-actions .btn-delete {
    color: var(--accent);
    border-color: var(--accent);
}

/* ========== FEEDBACK ========== */
.feedback-card {
    background: var(--bg);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}
.feedback-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.feedback-stars {
    color: #f5a623;
    font-size: 14px;
    letter-spacing: 1px;
}
.feedback-category {
    background: var(--surface2);
    color: var(--text-muted);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.feedback-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}
.feedback-message {
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}
.badge-count {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========== ONBOARDING WIZARD ========== */
.onboarding-card {
    background: linear-gradient(135deg, #f0f4ff 0%, #fce4e8 100%);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border);
}
.onboarding-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}
.onboarding-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.onboarding-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.onboarding-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(0,0,0,0.08);
    border-radius: 3px;
    overflow: hidden;
}
.onboarding-bar-fill {
    height: 100%;
    background: var(--green);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.onboarding-progress-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}
.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.onboarding-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface);
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}
.onboarding-step:hover { border-color: var(--blue); }
.onboarding-step.done { opacity: 0.6; }
.onboarding-step-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    color: transparent;
}
.onboarding-step.done .onboarding-step-check {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}
.onboarding-step-label { flex: 1; font-weight: 500; }
.onboarding-step-action {
    font-size: 12px;
    color: var(--blue);
    font-weight: 600;
}
.onboarding-step.done .onboarding-step-action { display: none; }
.onboarding-step-optional {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--surface2);
    padding: 2px 6px;
    border-radius: 4px;
}

.label-hint {
    font-weight: 400;
    font-size: 11px;
    color: var(--text-muted);
}

/* ========== ICAL HELP ========== */
.ical-help {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.ical-help summary {
    cursor: pointer;
    color: var(--blue);
    font-weight: 600;
    font-size: 12px;
}
.ical-steps {
    margin: 8px 0 4px 16px;
    line-height: 1.8;
}
.ical-steps li { margin-bottom: 2px; }
.ical-note {
    margin-top: 6px;
    color: var(--text-muted);
}
.ical-note code {
    background: var(--surface2);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 11px;
    word-break: break-all;
}

/* ========== MOBILE (< 768px) ========== */
@media (max-width: 767px) {
    /* Hide sidebar on mobile by default, slide in when .open */
    #sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        width: 260px;
        height: 100%;
        transition: left 0.25s ease;
        box-shadow: none;
    }

    #sidebar.open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    }

    #mobile-header {
        display: flex;
    }

    #mobile-nav {
        display: flex;
    }

    .view-scroll {
        padding: 16px;
    }

    .view-header {
        margin-bottom: 14px;
    }

    .view-title {
        font-size: 18px;
    }

    .today-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #chat-area { padding: 16px; }
    .msg { max-width: 85%; }
    #input-area { padding: 10px 12px; }
}

/* ========== TABLET (768px+) ========== */
@media (min-width: 768px) {
    /* Sidebar visible, no mobile header/nav */
    #mobile-header { display: none !important; }
    #mobile-nav { display: none !important; }

    #sidebar {
        position: relative;
        left: 0;
    }

    .modal { align-items: center; }
    .modal-content { border-radius: 20px; max-height: 70vh; }
    .login-box { padding: 60px 40px; }

    .view-scroll {
        max-width: 900px;
        margin: 0 auto;
        padding: 28px;
    }

    #chat-area { padding: 24px; }
    #messages { max-width: 700px; }
    .msg { max-width: 70%; }

    #templates-bar { padding: 10px 24px; justify-content: center; }
    #input-area { padding: 14px 24px; max-width: 700px; margin: 0 auto; width: 100%; }

    .today-grid { gap: 12px; }

    .msg-card { padding: 16px; }
    .booking-card { padding: 16px; }

    #messages-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    #messages-list .msg-card { margin-bottom: 0; }

    #bookings-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    #bookings-list .booking-card { margin-bottom: 0; }
}

/* ========== DESKTOP (1024px+) ========== */
@media (min-width: 1024px) {
    .login-box { padding: 80px 60px; max-width: 480px; }
    .logo { font-size: 42px; }
    .tagline { font-size: 18px; }
    .sub { font-size: 15px; }

    .view-scroll {
        max-width: 960px;
        padding: 32px;
    }

    #chat-area { padding: 32px; }
    #messages { max-width: 750px; }

    #templates-bar { padding: 12px 32px; gap: 10px; }
    .tmpl-btn { padding: 10px 18px; font-size: 14px; }

    #input-area { max-width: 750px; padding: 16px 32px; }
    #msg-input { padding: 14px 20px; font-size: 16px; }
    #btn-send { padding: 14px 24px; font-size: 16px; }

    .dash-title { font-size: 14px; }
    .today-grid { gap: 16px; }
    .today-card { padding: 20px 12px; }
    .today-num { font-size: 28px; }
    .today-label { font-size: 11px; }

    #messages-list { grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
    #bookings-list { grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

    .pricing-card { padding: 20px; }
    .pricing-stats { gap: 24px; }
    .pricing-stat-val { font-size: 18px; }

    .alert-card { padding: 14px 18px; }

    .modal-content { max-width: 560px; }
}

/* ========== WIDE DESKTOP (1280px+) ========== */
@media (min-width: 1280px) {
    .view-scroll { max-width: 1100px; }

    .dash-grid-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    #messages-list { grid-template-columns: repeat(3, 1fr); }
    #bookings-list { grid-template-columns: repeat(3, 1fr); }
}

/* ========== TOAST NOTIFICATIONS ========== */
#toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    animation: toast-in 0.3s ease forwards;
    max-width: 360px;
    line-height: 1.4;
}

.toast.toast-out {
    animation: toast-out 0.25s ease forwards;
}

.toast-success { background: var(--green); }
.toast-error { background: var(--accent); }
.toast-info { background: var(--blue); }
.toast-warning { background: var(--yellow); }

.toast-icon { font-size: 18px; flex-shrink: 0; }

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    cursor: pointer;
    padding: 0 0 0 8px;
    flex-shrink: 0;
}
.toast-close:hover { color: #fff; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

@media (max-width: 480px) {
    #toast-container { left: 16px; right: 16px; }
    .toast { max-width: none; }
}

/* ========== CLICKABLE TODAY CARDS ========== */
.today-card.clickable {
    cursor: pointer;
    position: relative;
}
.today-card.clickable:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.today-card.clickable.selected {
    border-color: var(--accent);
    background: var(--accent2);
}

/* Today detail expansion */
.today-details {
    margin-top: 12px;
    background: var(--bg);
    border-radius: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    animation: fadeIn 0.2s ease;
}
.today-details-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}
.today-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.today-detail-item:last-child {
    border-bottom: none;
}
.today-detail-name {
    font-weight: 600;
    color: var(--text);
}
.today-detail-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========== PHONE INPUT MODAL ========== */
.phone-modal-content {
    max-width: 400px;
}
.phone-modal-content label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    margin-top: 14px;
}
.phone-modal-content input[type="tel"] {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
    font-family: inherit;
}
.phone-modal-content input[type="tel"]:focus {
    border-color: var(--accent);
}
.phone-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}
.phone-modal-actions .btn-save {
    flex: 1;
    margin-top: 0;
    padding: 12px 20px;
}
.phone-modal-actions .btn-sm {
    padding: 12px 20px;
}

/* ========== OVERVIEW MINI SECTIONS ========== */
.overview-mini-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 6px;
    font-size: 13px;
}
.overview-mini-name {
    font-weight: 600;
    color: var(--text);
}
.overview-mini-meta {
    font-size: 12px;
    color: var(--text-muted);
}
.overview-mini-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}
.overview-ops-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s;
}
.overview-ops-row:hover {
    border-color: var(--accent);
}
.overview-ops-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}
.overview-ops-icon.issue { background: rgba(233,69,96,0.1); }
.overview-ops-icon.cleaning { background: rgba(217,119,6,0.1); }
.overview-ops-text {
    flex: 1;
    font-weight: 500;
    color: var(--text);
}
.overview-ops-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    text-transform: uppercase;
}
