:root {
    /* Dark Theme (Default) */
    --bg-main: hsl(222, 47%, 7%);
    --bg-panel: hsla(222, 47%, 12%, 0.85);
    --bg-card: hsla(222, 47%, 15%, 0.7);
    --glass-bg: hsla(222, 47%, 15%, 0.6);
    --glass-border: hsla(217, 33%, 17%, 0.8);
    
    --primary: hsl(255, 100%, 75%);
    --primary-glow: hsla(255, 100%, 75%, 0.3);
    --primary-hover: hsl(255, 100%, 80%);
    
    --secondary: hsl(190, 100%, 70%);
    --accent: hsl(330, 100%, 70%);
    
    --success: hsl(151, 76%, 38%);
    --success-strong: hsl(151, 82%, 28%);
    --warning: hsl(48, 96%, 53%);
    --danger: hsl(0, 84%, 60%);
    
    --text-main: hsl(210, 40%, 98%);
    --text-muted: hsl(215, 20%, 65%);
    --text-dim: hsl(215, 15%, 45%);
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.3);
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius: var(--radius-md);
    --primary-color: var(--primary);
    --success-color: var(--success);
    --error-color: var(--danger);
    --border-color: var(--glass-border);
    --bg-dashboard: var(--bg-card);
    --bg-hover: var(--glass-bg);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --date-icon-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

.light-mode {
    --bg-main: hsl(220, 33%, 96%);
    --bg-panel: hsla(220, 35%, 94%, 0.96);
    --bg-card: hsla(0, 0%, 100%, 0.92);
    --glass-bg: hsla(0, 0%, 100%, 0.78);
    --glass-border: hsla(215, 24%, 72%, 0.42);
    
    --primary: hsl(255, 80%, 60%);
    --primary-glow: hsla(255, 80%, 60%, 0.15);
    --primary-hover: hsl(255, 80%, 55%);
    --secondary: hsl(198, 88%, 44%);
    --accent: hsl(334, 82%, 58%);
    --success: hsl(151, 68%, 32%);
    --success-strong: hsl(151, 72%, 24%);
    
    --text-main: hsl(222, 47%, 11%);
    --text-muted: hsl(217, 21%, 34%);
    --text-dim: hsl(217, 16%, 50%);
    --date-icon-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231f2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

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

body { 
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif; 
    background-color: var(--bg-main); 
    background-image: radial-gradient(circle at 0% 0%, hsla(255, 100%, 75%, 0.05) 0%, transparent 50%),
                      radial-gradient(circle at 100% 100%, hsla(190, 100%, 70%, 0.05) 0%, transparent 50%);
    color: var(--text-main); 
    overflow: hidden;
    line-height: 1.5;
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--primary-glow); } 70% { box-shadow: 0 0 0 10px rgba(0,0,0,0); } 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); } }

.app-container { display: flex; height: 100vh; }

/* Sidebar */
.sidebar { 
    width: 280px; 
    background: var(--bg-panel); 
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border); 
    display: flex; 
    flex-direction: column; 
    transition: var(--transition);
    z-index: 100;
}

.sidebar-header { 
    padding: 2rem 1.5rem; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}

.logo-icon { 
    width: 40px; 
    height: 40px; 
    background: linear-gradient(135deg, var(--primary), var(--secondary)); 
    border-radius: var(--radius-md); 
    box-shadow: 0 0 20px var(--primary-glow);
}

.sidebar-header h2 { 
    font-size: 1.4rem; 
    font-weight: 800; 
    letter-spacing: -0.5px;
    background: linear-gradient(to right, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-item { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 10px 16px; 
    color: var(--text-muted); 
    text-decoration: none; 
    border-radius: var(--radius-md); 
    transition: var(--transition); 
    font-weight: 500; 
    font-size: 0.95rem; 
}

.nav-item i { width: 20px; height: 20px; }

.nav-item:hover { 
    background: var(--glass-bg); 
    color: var(--text-main); 
    transform: translateX(5px);
}

.nav-item.active { 
    background: var(--primary); 
    color: #fff; 
    box-shadow: 0 4px 15px var(--primary-glow);
}

.sidebar-footer { 
    padding: 1.5rem; 
    border-top: 1px solid var(--glass-border); 
}

.user-profile { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    background: var(--glass-bg);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.user-profile img { 
    width: 38px; 
    height: 38px; 
    border-radius: 50%; 
    border: 2px solid var(--primary);
}

.user-info strong { display: block; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info span { font-size: 0.75rem; color: var(--text-muted); }

/* Main Content */
.main-content { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    background: transparent;
    min-width: 0;
    position: relative;
}

.top-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0.6rem 2.5rem; 
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border); 
    position: relative;
    z-index: 40;
    overflow: visible;
}

.search-bar { 
    display: flex; 
    align-items: center; 
    background: var(--bg-main); 
    border: 1px solid var(--glass-border); 
    border-radius: var(--radius-lg); 
    padding: 0.6rem 1.2rem; 
    width: 400px; 
    transition: var(--transition);
    position: relative;
}

.search-bar:focus-within { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-bar i { color: var(--text-dim); margin-right: 10px; }
.search-bar input { background: none; border: none; color: var(--text-main); outline: none; width: 100%; font-size: 0.95rem; }

.search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.45);
    padding: 0.65rem;
    z-index: 120;
    max-height: min(60vh, 480px);
    overflow-y: auto;
}

.search-result-group + .search-result-group {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.search-result-group-title {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.35rem;
    padding: 0 0.35rem;
}

.search-result-item {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0.85rem;
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.search-result-item:hover,
.search-result-item.is-active {
    background: rgba(139, 92, 246, 0.14);
}

.search-result-item strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
}

.search-result-item span,
.search-result-item small {
    display: block;
    color: var(--text-dim);
    margin-top: 0.15rem;
    font-size: 0.78rem;
}

.search-result-empty {
    padding: 0.9rem 1rem;
    color: var(--text-dim);
    font-size: 0.88rem;
}

.search-result-badge {
    flex-shrink: 0;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.16);
    color: var(--secondary);
    font-size: 0.72rem;
    font-weight: 700;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-content: start;
}

.detail-grid > * {
    min-height: 0;
}

.detail-section {
    background: rgba(15, 23, 42, 0.68);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    padding: 1.15rem;
    min-width: 0;
}

.customer-detail-modal-content {
    max-width: min(1180px, calc(100vw - 40px)) !important;
    max-height: calc(100vh - 20px);
}

.customer-detail-body {
    padding-bottom: 2.25rem;
    overscroll-behavior: contain;
}

.customer-detail-section {
    position: relative;
    min-width: 0;
}

.customer-detail-section--wide {
    grid-column: 1 / -1 !important;
}

.customer-payment-form {
    display: grid !important;
    grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.8fr) auto;
    gap: 10px;
    margin-top: 1rem;
    align-items: center;
}

.customer-payment-history,
.customer-package-history {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}

#modalCustomerDetail .leads-table {
    min-width: 680px;
}

#modalCustomerDetail .modal-header {
    position: sticky;
    top: 0;
    z-index: 3;
    backdrop-filter: blur(14px);
}

.detail-section h3,
.detail-section h4 {
    margin-bottom: 0.75rem;
}

.provider-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1rem;
}

#modalCustomerDetail .modal-content {
    max-width: min(1100px, calc(100vw - 48px)) !important;
    max-height: calc(100vh - 28px);
}

#modalService .modal-content {
    max-width: min(760px, calc(100vw - 48px));
}

#serviceStaffCheckboxes {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 0.35rem;
}

/* Buttons */
.primary-btn { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    background: var(--primary); 
    color: #fff; 
    border: none; 
    padding: 0.7rem 1.4rem; 
    border-radius: var(--radius-md); 
    font-weight: 600; 
    cursor: pointer; 
    transition: var(--transition); 
}

.primary-btn:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 5px 15px var(--primary-glow);
    filter: brightness(1.1);
}

.outline-btn { 
    background: var(--glass-bg); 
    border: 1px solid var(--glass-border); 
    color: var(--text-main); 
    padding: 0.6rem 1.2rem; 
    border-radius: var(--radius-md); 
    cursor: pointer; 
    transition: var(--transition); 
    font-weight: 500;
}

.outline-btn:hover { 
    background: var(--primary); 
    color: #fff;
    border-color: var(--primary);
}

.w-full { width: 100%; }
.mt-2 { margin-top: 0.75rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

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

.form-group input,
.form-group select,
.form-group textarea,
.form-select,
.form-input {
    width: 100%;
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: rgba(9, 14, 29, 0.74);
    color: var(--text-main);
    padding: 0.85rem 0.95rem;
    outline: none;
    transition: var(--transition);
}

.light-mode .form-group input,
.light-mode .form-group select,
.light-mode .form-group textarea,
.light-mode .form-select,
.light-mode .form-input {
    background: rgba(255, 255, 255, 0.88);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-select:focus,
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-help {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group input[type="time"],
.schedule-filter-date {
    color-scheme: dark;
    background-image: var(--date-icon-dark);
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px 18px;
    padding-right: 2.8rem;
}

.light-mode .form-group input[type="date"],
.light-mode .form-group input[type="datetime-local"],
.light-mode .form-group input[type="time"],
.light-mode .schedule-filter-date {
    color-scheme: light;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator,
.form-group input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.form-group input[type="time"]::-webkit-calendar-picker-indicator,
.schedule-filter-date::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0;
    width: 22px;
    min-width: 22px;
    height: 22px;
}

/* Dashboard Content Area */
.dashboard-area { 
    padding: 2.5rem; 
    overflow-y: auto; 
    flex: 1; 
    animation: fadeIn 0.4s ease-out;
    position: relative;
    z-index: 1;
}

.view-panel { display: none; }
.view-panel.active { display: block; }

.page-header { margin-bottom: 2.5rem; animation: slideIn 0.5s ease-out; }
.page-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; color: var(--text-main); }
.page-header p { color: var(--text-muted); font-size: 1.1rem; }

/* Stats Grid */
.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 1.5rem; 
    margin-bottom: 3rem; 
}

.stat-card { 
    background: var(--bg-card); 
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border); 
    border-radius: var(--radius-lg); 
    padding: 1.8rem; 
    display: flex; 
    align-items: center; 
    gap: 1.5rem; 
    transition: var(--transition);
}

.stat-card:hover { 
    transform: translateY(-5px); 
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.stat-icon { 
    width: 64px; 
    height: 64px; 
    border-radius: var(--radius-md); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.5rem;
}

.stat-icon.purple { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }
.stat-icon.orange { background: linear-gradient(135deg, var(--warning), var(--accent)); color: #fff; }
.stat-icon.green { background: linear-gradient(135deg, var(--success), var(--secondary)); color: #fff; }

.stat-details h3 { font-size: 0.95rem; color: var(--text-muted); font-weight: 500; margin-bottom: 6px; }
.stat-value { font-size: 2rem; font-weight: 800; }

/* Tables */
.leads-section { 
    background: var(--bg-card); 
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border); 
    border-radius: var(--radius-lg); 
    padding: 2rem; 
}

.table-container { 
    overflow-x: auto; 
    margin-top: 1rem; 
}

.leads-table { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 0 8px; 
}

.leads-table th { 
    text-align: left; 
    padding: 1rem 1.5rem; 
    color: var(--text-dim); 
    font-weight: 600; 
    font-size: 0.85rem; 
    text-transform: uppercase; 
    letter-spacing: 1px;
}

.leads-table tr { transition: var(--transition); }

.leads-table td { 
    padding: 0.8rem 1.5rem; 
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.9rem; 
    vertical-align: middle;
}

.leads-table td:first-child { border-left: 1px solid var(--glass-border); border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md); }
.leads-table td:last-child { border-right: 1px solid var(--glass-border); border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }

.leads-table tr:hover td { 
    background: hsla(255, 100%, 75%, 0.05); 
    border-color: var(--primary);
}

.status-badge { 
    padding: 0.4rem 1rem; 
    border-radius: 20px; 
    font-size: 0.75rem; 
    font-weight: 700; 
}

.status-onayli { background: rgba(5, 150, 105, 0.18); color: var(--success-strong); }
.status-bekliyor { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.status-iptal { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.status-pasif { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }

.action-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--bg-main);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.light-mode .action-btn {
    background: rgba(255, 255, 255, 0.96);
}

.action-btn:hover {
    transform: translateY(-1px);
    border-color: currentColor;
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.14);
}

.action-btn svg,
.action-btn i {
    width: 18px;
    height: 18px;
    stroke-width: 2.15;
}

.btn-sm {
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
}

.split-panel {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1rem;
}

.stats-mini {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 1rem;
}

.stats-mini-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.stats-mini-item span {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.stats-mini-item strong {
    font-size: 1.5rem;
    color: var(--text-main);
}

.reservation-primary {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.reservation-name {
    font-weight: 700;
    color: var(--text-main);
}

.reservation-subline {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.source-online {
    background: rgba(99, 102, 241, 0.16);
    color: var(--primary);
}

.source-manual {
    background: rgba(16, 185, 129, 0.14);
    color: var(--success);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-center {
    position: relative;
    z-index: 45;
}

.notification-btn {
    position: relative;
    min-width: 52px;
    justify-content: center;
    padding-inline: 0.9rem;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(420px, 85vw);
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1rem;
    z-index: 1600;
}

.notification-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 0.85rem;
}

.notification-panel-header p {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.notification-permission {
    margin-bottom: 0.85rem;
    padding: 0.8rem;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.08);
    border: 1px dashed rgba(99, 102, 241, 0.4);
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 420px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.9rem;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.notification-item.unread {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.notification-item-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.notification-item-title {
    font-weight: 700;
    color: var(--text-main);
}

.notification-item-time {
    color: var(--text-dim);
    font-size: 0.75rem;
    white-space: nowrap;
}

.notification-item-message {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.notification-item-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.notification-summary-card {
    align-items: flex-start;
}

.notification-page-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.notification-page-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 1rem;
}

.toast-container {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2500;
}

.toast {
    min-width: 280px;
    max-width: 360px;
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 0.95rem 1rem;
    box-shadow: var(--shadow-md);
    animation: fadeIn 0.25s ease-out;
}

.toast strong {
    display: block;
    margin-bottom: 4px;
}

.toast p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.hidden {
    display: none !important;
}

/* Modals */
.modal { 
    display: none; 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.8); 
    backdrop-filter: blur(8px);
    z-index: 2000; 
    justify-content: center; 
    align-items: center; 
    padding: 2rem;
    overflow-y: auto;
}

.modal.active { display: flex; align-items: flex-start; animation: fadeIn 0.3s ease-out; }

.modal-content { 
    background: var(--bg-panel); 
    border: 1px solid var(--glass-border); 
    border-radius: var(--radius-lg); 
    width: 100%; 
    max-width: 650px; 
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md); 
    position: relative;
    overflow: hidden;
    margin: auto;
}

#modalReservation form,
#modalEditReservation form,
.modal-form-shell {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

#modalCustomerDetail .modal-body,
.modal-standalone-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

#modalReservation form,
#modalEditReservation form {
    width: 100%;
}

.modal-header { 
    padding: 1.5rem 2rem;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    padding: 1.5rem 2rem;
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.ai-support-modal-content {
    max-width: min(980px, calc(100vw - 40px));
    max-height: calc(100vh - 24px);
}

.ai-support-body {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.ai-support-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    gap: 1rem;
}

.ai-support-panel,
.ai-support-status-card,
.ai-support-step,
.ai-support-faq-item {
    background: rgba(15, 23, 42, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
}

.ai-support-panel {
    padding: 1.2rem 1.25rem;
}

.ai-support-panel h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.ai-support-panel p {
    color: var(--text-muted);
    line-height: 1.65;
}

.ai-support-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.ai-support-status-card {
    padding: 0.95rem 1rem;
}

.ai-support-status-card strong {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: 0.4rem;
}

.ai-support-status-card span {
    display: block;
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text-main);
}

.ai-support-status-card p {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.ai-support-status-card[data-tone="good"] {
    border-color: rgba(16, 185, 129, 0.28);
}

.ai-support-status-card[data-tone="warn"] {
    border-color: rgba(245, 158, 11, 0.24);
}

.ai-support-status-card[data-tone="focus"] {
    border-color: rgba(139, 92, 246, 0.28);
}

.ai-support-search {
    width: 100%;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.72);
    color: var(--text-main);
    padding: 0.95rem 1rem;
    font-size: 0.95rem;
    outline: none;
}

.ai-support-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.ai-support-section {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.ai-support-section h4 {
    font-size: 1rem;
    font-weight: 700;
}

.ai-support-step-list,
.ai-support-faq-list {
    display: grid;
    gap: 0.8rem;
}

.ai-support-step {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem 1.05rem;
}

.ai-support-step-index {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.ai-support-step strong,
.ai-support-faq-item strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}

.ai-support-step p,
.ai-support-faq-item p,
.ai-support-empty {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.88rem;
}

.ai-support-faq-item {
    padding: 1rem 1.05rem;
}

.ai-support-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.ai-support-note {
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.86rem;
}

.reservation-modal-content {
    max-width: min(1040px, calc(100vw - 72px));
    max-height: calc(100vh - 24px);
}

.reservation-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    padding-bottom: 2.25rem;
    min-height: 0;
}

.reservation-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.2rem;
}

.reservation-form-grid .form-group.full-span {
    grid-column: 1 / -1;
}

.reservation-time-panel {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.18), transparent 38%),
        rgba(9, 14, 29, 0.72);
    border-radius: 20px;
    padding: 1.15rem;
}

.reservation-time-panel .form-help {
    color: rgba(226, 232, 240, 0.76);
}

.reservation-time-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.reservation-time-header h4 {
    font-size: 1rem;
    margin: 0;
}

.selected-time-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 124px;
    min-height: 38px;
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
    background: rgba(99, 102, 241, 0.24);
    border: 1px solid rgba(129, 140, 248, 0.45);
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.85rem;
}

.time-grid,
.auto-session-slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 0.7rem;
}

.time-slot-mini {
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.2rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.7);
    color: var(--text-main);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.time-slot-mini:hover {
    transform: translateY(-1px);
    border-color: rgba(129, 140, 248, 0.45);
    background: rgba(99, 102, 241, 0.12);
}

.time-slot-mini:disabled {
    cursor: not-allowed;
}

.time-slot-mini.selected {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9), rgba(56, 189, 248, 0.9));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.22);
}

.time-slot-mini.taken {
    cursor: not-allowed;
    color: var(--text-dim);
    background: rgba(148, 163, 184, 0.12);
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.auto-res-options {
    display: none;
    margin-top: 1rem;
}

.auto-session-shell {
    border-radius: 18px;
    padding: 1rem;
    border: 1px solid rgba(129, 140, 248, 0.18);
    background: rgba(12, 19, 35, 0.72);
}

.auto-session-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    max-height: min(40vh, 360px);
    overflow-y: auto;
    padding-right: 0.35rem;
    align-content: start;
}

.auto-session-grid::-webkit-scrollbar,
.reservation-modal-body::-webkit-scrollbar {
    width: 10px;
}

.auto-session-grid::-webkit-scrollbar-track,
.reservation-modal-body::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.08);
    border-radius: 999px;
}

.auto-session-grid::-webkit-scrollbar-thumb,
.reservation-modal-body::-webkit-scrollbar-thumb {
    background: rgba(129, 140, 248, 0.42);
    border-radius: 999px;
}

.auto-session-card {
    border-radius: 18px;
    border: 1px solid rgba(129, 140, 248, 0.18);
    background: rgba(15, 23, 42, 0.68);
    padding: 1rem;
}

.light-mode .modal {
    background: rgba(15, 23, 42, 0.38);
}

.light-mode .modal-content {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(238, 242, 255, 0.98));
    border-color: rgba(148, 163, 184, 0.35);
}

.light-mode .modal-header,
.light-mode .modal-footer {
    background: rgba(255, 255, 255, 0.9);
}

.light-mode .reservation-time-panel {
    border-color: rgba(99, 102, 241, 0.18);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 242, 255, 0.96));
}

.light-mode .reservation-time-panel .form-help {
    color: hsl(217, 21%, 38%);
}

.light-mode .selected-time-pill {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.28);
    color: hsl(224, 49%, 24%);
}

.light-mode .time-slot-mini {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(148, 163, 184, 0.42);
    color: hsl(222, 47%, 18%);
}

.light-mode .time-slot-mini:hover {
    background: rgba(99, 102, 241, 0.08);
}

.light-mode .time-slot-mini.taken {
    background: rgba(148, 163, 184, 0.15);
    color: hsl(217, 12%, 48%);
}

.light-mode .auto-session-shell {
    background: linear-gradient(135deg, rgba(241, 245, 249, 0.94), rgba(224, 231, 255, 0.9));
    border-color: rgba(99, 102, 241, 0.16);
}

.light-mode .auto-session-card {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(148, 163, 184, 0.28);
}

.auto-session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.auto-session-card-header strong {
    font-size: 0.95rem;
}

.auto-session-card-header span {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.session-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    border: 1px dashed rgba(129, 140, 248, 0.25);
    border-radius: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
}

.schedule-filter-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.schedule-filter-date {
    min-height: 38px;
    padding: 0.45rem 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.48);
    color: var(--text-main);
}

.subscription-lock-banner {
    display: none;
    margin-bottom: 1.5rem;
    padding: 1rem 1.15rem;
    border-radius: 18px;
    border: 1px solid rgba(248, 113, 113, 0.25);
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.42), rgba(91, 33, 182, 0.28));
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.22);
}

.subscription-lock-banner.active {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.subscription-lock-banner strong {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
}

.subscription-lock-banner p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.88rem;
}

.subscription-lock-notice {
    display: none;
    margin-bottom: 1.5rem;
    border-radius: 20px;
    border: 1px solid rgba(129, 140, 248, 0.2);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(67, 56, 202, 0.22));
    padding: 1.4rem;
}

.subscription-lock-notice.active {
    display: block;
}

.subscription-lock-notice h3 {
    margin-bottom: 0.45rem;
    font-size: 1.05rem;
}

.subscription-lock-notice p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.bot-status-grid,
.content-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.bot-status-card {
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid rgba(129, 140, 248, 0.16);
    background: rgba(15, 23, 42, 0.48);
}

.bot-status-card h4 {
    margin-bottom: 0.25rem;
    font-size: 0.86rem;
    color: var(--text-muted);
}

.bot-status-card strong {
    font-size: 1.35rem;
}

.bot-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    padding: 0.42rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(251, 191, 36, 0.14);
    color: #fbbf24;
}

.bot-status-chip.live {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
}

.automation-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-top: 1rem;
}

.automation-checklist--spacious {
    gap: 0.9rem;
}

.automation-checklist div {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.bot-day-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.35rem;
}

.bot-day-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    min-height: 40px;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(129, 140, 248, 0.24);
    background: rgba(15, 23, 42, 0.42);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.bot-day-chip:hover {
    border-color: rgba(129, 140, 248, 0.42);
    color: var(--text-main);
}

.bot-day-chip.selected {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.85), rgba(56, 189, 248, 0.78));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.2);
}

.bot-day-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.bot-channel-note {
    margin: 0.5rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.bot-whatsapp-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    min-height: 100%;
}

#view-sales-bot > .bot-header-card,
#view-sales-bot > #bot-panel-instagram,
#view-sales-bot > #bot-panel-whatsapp {
    display: none !important;
}

.bot-status-grid--compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bot-channel-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.15rem;
}

.bot-channel-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    border-radius: 18px;
    padding: 1.05rem 1.2rem;
    border: 1px solid rgba(129, 140, 248, 0.18);
    background: rgba(15, 23, 42, 0.34);
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.bot-channel-tab i {
    width: 20px;
    height: 20px;
}

.bot-channel-tab.active {
    color: #fff;
    border-color: rgba(129, 140, 248, 0.4);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.26), rgba(56, 189, 248, 0.18));
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.22);
}

.bot-channel-page {
    display: none;
}

.bot-channel-page.active {
    display: block;
}

.bot-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.95fr);
    gap: 1.25rem;
    align-items: start;
}

.bot-page-grid--whatsapp {
    grid-template-columns: minmax(0, 1fr);
}

#view-sales-bot .stat-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 1.25rem;
}

#view-sales-bot .stat-card > * {
    min-width: 0;
}

.bot-page-main,
.bot-page-side {
    min-width: 0;
}

.bot-page-main--full {
    width: 100%;
}

.bot-page-side {
    position: sticky;
    top: 1.25rem;
}

.bot-whatsapp-shell {
    display: grid;
    gap: 1.1rem;
}

.bot-whatsapp-top {
    display: grid;
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.bot-setup-card {
    border-radius: 22px;
    border: 1px solid rgba(129, 140, 248, 0.16);
    background: linear-gradient(180deg, rgba(18, 27, 49, 0.92), rgba(14, 22, 41, 0.84));
    padding: 1.1rem;
    min-width: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.bot-setup-card-head h4,
.bot-whatsapp-status-row h4 {
    margin: 0.3rem 0 0.45rem;
}

.bot-setup-card-head p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.bot-setup-card--guide {
    justify-content: space-between;
}

.bot-whatsapp-status-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bot-connect-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(129, 140, 248, 0.16);
    background: rgba(15, 23, 42, 0.28);
}

.bot-connect-card h4 {
    margin: 0.28rem 0 0.4rem;
}

.bot-connect-card--wide {
    margin-bottom: 0;
}

.bot-connect-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bot-advanced-panel {
    border: 1px solid rgba(129, 140, 248, 0.16);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.24);
    overflow: hidden;
}

.bot-advanced-panel summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.bot-advanced-panel summary::-webkit-details-marker {
    display: none;
}

.bot-advanced-panel summary::after {
    content: '+';
    color: #a78bfa;
    font-size: 1.1rem;
}

.bot-advanced-panel[open] summary::after {
    content: '-';
}

.bot-advanced-panel-body {
    padding: 0 1.1rem 1.1rem;
}

.bot-primary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.bot-primary-head h3,
.bot-qr-card h3,
.bot-bottom-grid h3 {
    margin: 0.2rem 0 0.45rem;
}

.bot-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a78bfa;
}

.bot-quick-toggle {
    min-width: 144px;
}

.bot-coming-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.32rem 0.7rem;
    font-size: 0.74rem;
    font-weight: 700;
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
}

.bot-connection-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin: 1rem 0 0.8rem;
}

.bot-channel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bot-channel-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.bot-muted-copy {
    margin: 0 0 0.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.bot-side-note {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.9rem;
}

.bot-simple-list {
    margin: 0.9rem 0 0;
    padding-left: 1rem;
    color: var(--text-muted);
    display: grid;
    gap: 0.55rem;
}

.bot-value-box {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(129, 140, 248, 0.18);
    background: rgba(15, 23, 42, 0.34);
    font-weight: 700;
    color: var(--text-main);
}

.bot-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group--span-2 {
    grid-column: 1 / -1;
}

.bot-form-grid--whatsapp {
    margin-bottom: 0;
}

.bot-form-grid--tight {
    margin-bottom: 0;
}

.bot-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.bot-inline-summary {
    font-size: 0.88rem;
    color: var(--text-muted);
    flex: 1 1 280px;
}

.bot-inline-panels,
.bot-secondary-grid,
.bot-bottom-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.bot-secondary-grid,
.bot-bottom-grid {
    margin-top: 1.25rem;
}

.bot-bottom-grid {
    grid-template-columns: 1fr;
}

.bot-mini-panel {
    border: 1px solid rgba(129, 140, 248, 0.16);
    border-radius: 18px;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.3);
    min-width: 0;
}

.bot-mini-panel h4 {
    margin-bottom: 0.75rem;
}

.bot-mini-panel .form-group:last-child {
    margin-bottom: 0;
}

.bot-mini-panel--dayblock {
    background: rgba(15, 23, 42, 0.46);
}

.bot-qr-card {
    height: 100%;
}

.bot-qr-frame {
    display: grid;
    place-items: center;
    min-height: 248px;
    border-radius: 24px;
    margin: 1rem 0;
    border: 1px dashed rgba(129, 140, 248, 0.3);
    background:
        radial-gradient(circle at top, rgba(129, 140, 248, 0.14), transparent 48%),
        rgba(15, 23, 42, 0.52);
    cursor: zoom-in;
}

.bot-qr-frame--inline {
    min-height: 260px;
    margin: 0.85rem 0 1rem;
    cursor: default;
}

.bot-qr-frame--large {
    min-height: 320px;
}

.bot-qr-frame img {
    width: min(280px, 100%);
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 18px;
    background: #fff;
    padding: 10px;
}

.bot-qr-actions {
    display: grid;
    gap: 0.8rem;
}

.bot-action-row--primary {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(129, 140, 248, 0.12);
}

.bot-log-list {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 0.35rem;
}

.bot-empty-link {
    pointer-events: none;
    opacity: 0.65;
}

.bot-status-chip.off {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5f5;
}

.bot-status-chip.draft {
    background: rgba(59, 130, 246, 0.16);
    color: #60a5fa;
}

.bot-status-chip.live {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
}

.bot-qr-modal-content {
    max-width: 720px;
}

.bot-qr-modal-body {
    display: grid;
    gap: 1rem;
}

.bot-qr-modal-frame {
    display: grid;
    place-items: center;
    min-height: 380px;
    border-radius: 24px;
    border: 1px dashed rgba(129, 140, 248, 0.26);
    background: rgba(15, 23, 42, 0.36);
    padding: 1rem;
}

.bot-qr-modal-frame img {
    width: min(420px, 100%);
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 18px;
    background: #fff;
    padding: 12px;
}

.bot-qr-modal-actions {
    display: grid;
    gap: 0.75rem;
}

.draft-item {
    border: 1px solid rgba(129, 140, 248, 0.16);
    padding: 1rem;
    border-radius: 16px;
    margin-bottom: 0.9rem;
    background: rgba(15, 23, 42, 0.48);
}

.draft-item img {
    width: 100%;
    border-radius: 12px;
    margin: 0.8rem 0;
    border: 1px solid rgba(129, 140, 248, 0.14);
}

.close-modal { 
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border); 
    color: var(--text-muted); 
    cursor: pointer; 
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}

.close-modal:hover { background: var(--danger); color: #fff; }

/* Gallery / Media */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 1rem;
}

.media-item {
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--glass-border);
    cursor: pointer;
    transition: var(--transition);
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item:hover { transform: scale(1.05); border-color: var(--primary); }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* --- Mobile --- */
@media (max-width: 1024px) {
    .sidebar { position: fixed; left: -280px; top: 0; bottom: 0; z-index: 1000; }
    .sidebar.mobile-active { left: 0; }
    .top-header { padding: 1rem; }
    .search-bar { display: none; }
    .split-panel { grid-template-columns: 1fr; }
    .header-actions { flex-wrap: wrap; justify-content: flex-end; }
    .customer-payment-form { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
}

@media (max-width: 768px) {
    :root {
        --radius-md: 12px;
    }
    
    body { font-size: 14px; }
    
    .stats-grid { grid-template-columns: 1fr; }
    .stats-mini { grid-template-columns: repeat(2, 1fr); }
    .stats-row { grid-template-columns: repeat(2, 1fr) !important; }
    
    .modal-content {
        max-width: 100%;
        margin: 0;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .modal-body { padding: 1rem; }
    .modal-header { padding: 1rem; }
    .modal-footer { padding: 0.75rem 1rem; }
    
    .detail-grid,
    .provider-fields { grid-template-columns: 1fr; }
    
    .page-header h1 { font-size: 1.25rem; }
    .page-header p { font-size: 0.8rem; }
    .dashboard-area { padding: 1rem; }
    
    .notification-panel { width: min(92vw, 420px); right: -20px; }
    .toast-container { left: 12px; right: 12px; bottom: 12px; }
    .toast { min-width: 0; max-width: none; }
    
    /* Table horizontal scroll */
    .table-container,
    .data-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table { min-width: 600px; }
    
    th, td {
        padding: 8px 10px;
        font-size: 0.78rem;
        white-space: nowrap;
    }
    
    /* Grid sections → stacked */
    .reservation-form-grid,
    .bot-status-grid,
    .content-form-grid,
    .auto-session-grid,
    .bot-form-grid,
    .bot-bottom-grid,
    .bot-inline-panels,
    .bot-secondary-grid,
    .bot-page-grid,
    .bot-connection-row {
        grid-template-columns: 1fr;
    }
    
    .reservation-modal-content {
        max-width: 100%;
    }
    
    .bot-primary-head,
    .bot-action-row,
    .bot-channel-header,
    .bot-channel-actions,
    .bot-connect-card,
    .bot-connect-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bot-whatsapp-top {
        grid-template-columns: 1fr;
    }
    
    .bot-status-grid--compact,
    .bot-channel-switch {
        grid-template-columns: 1fr;
    }
    
    .bot-page-side {
        position: static;
    }
    
    .bot-qr-frame--large {
        min-height: 260px;
    }
    
    .bot-qr-frame img {
        width: min(240px, 100%);
    }
    
    .bot-qr-modal-content {
        max-width: 100%;
    }
    
    .bot-qr-modal-frame {
        min-height: 280px;
    }
    
    .ai-support-hero,
    .ai-support-status-grid {
        grid-template-columns: 1fr;
    }
    
    .ai-support-actions {
        flex-direction: column;
    }
    
    /* Touch-friendly form elements */
    input, select, textarea, .form-group input, .form-group select, .form-group textarea {
        font-size: 16px !important; /* Prevents iOS zoom */
        min-height: 44px;
        padding: 10px 12px;
    }
    
    button, .primary-btn, .outline-btn {
        min-height: 44px;
        font-size: 0.9rem;
    }
    
    /* Stat cards compact */
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    /* Subscription page mobile */
    #view-subscription .stats-row {
        grid-template-columns: 1fr 1fr 1fr !important;
    }
    
    /* Media grid */
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
    }
    
    /* Admin sections */
    .admin-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .dashboard-area { padding: 0.75rem; }
    .page-header h1 { font-size: 1.1rem; }
    
    .stats-row { grid-template-columns: 1fr !important; gap: 8px !important; }
    .stats-mini { grid-template-columns: 1fr; }
    
    /* Subscription cards stack on small phones */
    #view-subscription > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    .top-header {
        padding: 0.65rem 0.75rem;
    }
    
    .header-actions .primary-btn span,
    .header-actions .outline-btn span {
        display: none;
    }
    
    /* Hide less important header buttons text on very small screens */
    .header-actions > *:not(:last-child):not(:nth-last-child(2)) {
        font-size: 0;
    }
    .header-actions > *:not(:last-child):not(:nth-last-child(2)) i {
        font-size: initial;
    }
    
    .stat-card {
        padding: 0.85rem;
    }
    
    .stat-label { font-size: 0.7rem; }
    .stat-value { font-size: 1.2rem; }
    
    /* Full-width buttons */
    .primary-btn, .outline-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Stack satisfaction buttons vertically */
    #satisfactionBtns {
        flex-direction: column;
    }
    
    #satisfactionBtns .outline-btn {
        width: 100%;
    }
    
    /* Subscription add-on cards */
    .stat-card[style*="display:flex"][style*="align-items:center"] {
        flex-wrap: wrap;
    }
}

/* Sidebar mobile overlay */
@media (max-width: 1024px) {
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(2px);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

/* Safe area insets for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    .sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .modal-footer {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    }
}

/* Print styles */
@media print {
    .sidebar, .top-header, .modal, .toast-container { display: none !important; }
    .main-content { margin: 0; padding: 0; }
    .dashboard-area { padding: 0; }
}

