:root {
    /* Colors - Updated for PlacesXP purple theme */
    --bg-purple: #6366f1;
    --bg-purple-dark: #4f46e5;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    --error-bg: #ff9b8a;
    --error-text: #7f1d1d;
    --link-color: #6366f1;
    --border-light: #e2e8f0;
    --success: #10b981;
    --yellow-border: #FFD700;

    /* Effects */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-purple) 0%, var(--bg-purple-dark) 100%);
    color: var(--text-dark);
    overflow-x: hidden;
    min-height: 100vh;
}

h1,
h2,
h3,
.logo {
    font-family: 'Outfit', sans-serif;
}

.hidden {
    display: none !important;
}

/* Authentication Screens */
.full-screen-center {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    max-width: 500px;
}

.logo-section {
    text-align: center;
}

.logo-image {
    width: 300px;
    height: auto;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2.5rem;
    width: 100%;
    box-shadow: var(--shadow-card);
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Forms */
.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-dark);
    font-weight: 500;
}

input[type="email"],
input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    color: var(--text-dark);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

input:focus,
textarea:focus {
    border-color: var(--link-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input::placeholder {
    color: var(--text-muted);
}

/* OTP Input Styling */
#otp-code {
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    font-weight: 600;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 0.125rem;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-group label {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    cursor: pointer;
}

/* Error Messages */
.error-msg {
    background: #ff9b8a;
    color: #1f2937;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Buttons */
.primary-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: 2px solid var(--link-color);
    border-radius: 0.5rem;
    color: var(--link-color);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

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

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.secondary-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Error Messages */
.error-msg {
    background: var(--error-bg);
    color: var(--error-text);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
}

.error-msg.hidden {
    display: none;
}

/* Links */
.link-text {
    color: var(--link-color);
    text-decoration: underline;
    cursor: pointer;
    transition: var(--transition);
}

.link-text:hover {
    color: var(--bg-purple-dark);
}

.help-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 1.5rem;
    line-height: 1.6;
}

/* Dashboard */
.main-header {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#user-display {
    color: var(--text-dark);
    font-weight: 500;
}

.content-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    background: #f8fafc;
    min-height: calc(100vh - 70px);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-dark);
}

.small-btn {
    width: auto;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

/* Table */
.table-wrapper {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-dark);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: #f8fafc;
}

.loading-state {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem !important;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard Specific Styles */
.user-dropdown {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-info-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.user-info-group:hover {
    background: rgba(0, 0, 0, 0.03);
}

.dropdown-arrow {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.user-info-group.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    z-index: 100;
}

.logout-link {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: var(--transition);
}

.logout-link:hover {
    background: #fef2f2;
}

.org-name {
    font-size: 0.75rem;
    color: var(--link-color);
}

.places-count {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bulk-actions {
    display: flex;
    gap: 0.5rem;
}

.search-container {
    position: relative;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    width: 250px;
    font-size: 0.875rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--link-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Table Enhancements */
.place-link {
    color: var(--text-dark);
    text-decoration: underline;
    font-weight: 500;
}

.place-link:hover {
    color: var(--link-color);
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-published {
    background: #d1fae5;
    color: #065f46;
}

.status-draft {
    background: #fef3c7;
    color: #92400e;
}

.status-pending {
    background: #dbeafe;
    color: #1e40af;
}

.status-disabled {
    background: #f3f4f6;
    color: #6b7280;
}

/* Drawer Component */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
}

.drawer-container {
    width: 900px;
    max-width: 90vw;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

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

.drawer-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.close-drawer-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.close-drawer-btn:hover {
    color: var(--text-dark);
}

.drawer-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    overflow-y: auto;
}

.drawer-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.add-language-btn {
    background: transparent;
    border: 1px dashed var(--link-color);
    color: var(--link-color);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    text-align: left;
}

.add-set-btn {
    background: #1e293b;
    border: none;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    transition: var(--transition);
    text-align: center;
    width: 100%;
}

.add-language-btn:hover {
    background: rgba(99, 102, 241, 0.05);
}

.add-set-btn:hover {
    background: #0f172a;
    transform: translateY(-1px);
}

.helper-text {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.location-mode-toggle {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.875rem;
    color: var(--text-dark);
    cursor: pointer;
}

.radio-option input[type="radio"] {
    accent-color: var(--bg-purple);
}

.location-row {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

.location-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.location-field.wide {
    flex: 2;
}

.location-field label {
    font-size: 0.875rem;
    color: var(--text-dark);
    font-weight: 500;
}

.map-footer {
    display: flex;
    justify-content: space-between;
    padding: 6px 2px;
    font-size: 12px;
    color: var(--text-muted);
}

.char-counter {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.amenities-section {
    margin-top: 0.5rem;
}

.amenities-section>label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-dark);
    font-weight: 500;
}

/* Live Preview */
.drawer-preview h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.preview-card {
    border: 3px solid var(--yellow-border);
    border-radius: 0.75rem;
    overflow: hidden;
    background: white;
}

.preview-image-container {
    position: relative;
}

.preview-image {
    width: 100%;
    height: 200px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.upload-placeholder span {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.upload-placeholder p {
    font-size: 0.875rem;
}

.place-name-overlay {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 1.125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview-details {
    padding: 1.5rem;
}

.preview-place-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.preview-location {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.preview-description {
    color: var(--text-dark);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.preview-amenities {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.amenity-icon {
    background: #f3f4f6;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.preview-sets {
    border-top: 1px solid var(--border-light);
    padding-top: 1rem;
}

.sets-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sets-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.no-sets {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-style: italic;
}

/* Drawer Footer */
.drawer-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.drawer-footer button {
    flex: 1;
}

.drawer-footer button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.public-place-modal {
    width: min(900px, 100%);
    max-height: calc(100vh - 4rem);
    background: #f8f7f7;
    border-radius: 24px;
    border: 1px solid #d1d5db;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.public-place-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 2rem 2rem 1rem;
}

.public-place-modal-header h2 {
    margin: 0 0 0.75rem;
    font-size: 2rem;
    color: var(--text-dark);
}

.public-place-modal-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.public-place-modal-body {
    padding: 0 2rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: var(--text-muted);
}

.public-place-modal-body p {
    margin: 0;
    line-height: 1.55;
}

.public-place-modal-body textarea {
    min-height: 180px;
    resize: vertical;
}

.public-place-modal-footer {
    padding: 1.5rem 2rem 2rem;
}

/* Public Place Section & Header Adjustments */
.header-main-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-subheader {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-dark);
    margin: 0;
}

.custom-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 1.5rem;
    padding: 0 4px;
}

.hidden-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    opacity: 0;
}

.custom-checkbox {
    width: 24px;
    height: 24px;
    background-color: #FBF5EE;
    border: 2px solid #889BFB;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: var(--transition);
    display: inline-block;
}

/* Specific alignment for the public place one which has more text */
.public-place-selection .custom-checkbox {
    margin-top: 4px;
}

input[type="checkbox"].hidden-checkbox:checked+.custom-checkbox {
    background-color: #889BFB;
}

.public-place-info,
.checkbox-label-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.public-place-info h3,
.checkbox-label-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.checkbox-label-text {
    font-weight: 500;
    line-height: 24px;
    /* Center with 24px checkbox */
    cursor: pointer;
}

.public-place-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-card {
        padding: 2rem 1.5rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .logo-image {
        width: 200px;
    }

    .main-header {
        width: 100%;
        min-width: 0;
    }

    .content-container {
        padding: 1rem;
        width: 100%;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .top-bar-actions {
        flex-wrap: wrap;
        width: 100%;
    }

    .search-input {
        width: 100%;
    }

    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.875rem;
        min-width: 700px;
    }

    th,
    td {
        padding: 0.75rem 1rem;
        white-space: nowrap;
    }

    /* Fix for Customer Dashboard background on mobile */
    body.dashboard-view {
        background: #f8fafc !important;
    }

    #dashboard-section {
        background-color: #f8fafc;
        min-height: 100vh;
        position: relative;
        z-index: 1;
    }

    #customers-section {
        background-color: #fdfdfd;
        min-height: 100vh;
        position: relative;
        z-index: 1;
    }

    #customers-section .content-container {
        padding: 1rem !important;
    }

    #customers-section .table-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    #customers-section table {
        min-width: 900px;
    }
}

/* ──────────────────────────────────────────
   Manage Managers Drawer
────────────────────────────────────────── */
.mu-drawer {
    width: 520px;
    max-width: 95vw;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #fff;
}

.mu-drawer-header {
    border-bottom: 1px solid var(--border-light);
    padding: 28px 32px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.mu-drawer-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 6px;
}

.mu-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Scrollable body */
.mu-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.mu-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mu-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.mu-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-dark);
    text-transform: none;
    letter-spacing: 0;
}

/* "Enter email + Add" row */
.mu-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mu-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-dark);
    background: #fff;
    outline: none;
    transition: var(--transition);
}

.mu-input:focus {
    border-color: var(--link-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.mu-add-btn {
    padding: 10px 18px;
    background: #e5e7eb;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.mu-add-btn:hover {
    background: #d1d5db;
}

.mu-add-btn--active {
    background: #889BFB;
    border-color: #889BFB;
    color: #fff;
}

.mu-add-btn--active:hover {
    background: #7080e8;
    border-color: #7080e8;
}

/* Manager rows: [Role dropdown] [Email] [Delete] */
.mu-user-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mu-user-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mu-role-select {
    width: 130px;
    flex-shrink: 0;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-dark);
    background: #fff;
    cursor: pointer;
    outline: none;
}

.mu-email-display {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
    background: #fafafa;
    cursor: default;
}

.mu-delete-btn {
    padding: 9px 14px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.mu-delete-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Footer */
.mu-footer {
    padding: 16px 32px 28px;
    border-top: 1px solid var(--border-light);
    background: #fff;
    display: flex;
    justify-content: flex-end;
}

.mu-update-btn {
    width: auto;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    background: var(--link-color);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition);
}

.mu-update-btn:hover {
    background: var(--bg-purple-dark);
}

.mu-update-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Analytics Dashboard */
#analytics-section.analytics-shell {
    --analytics-bg: #0d1117;
    --analytics-panel: #1c2333;
    --analytics-panel-deep: #111827;
    --analytics-line: #2d3748;
    --analytics-line-soft: rgba(255, 255, 255, .07);
    --analytics-text: #eef2f7;
    --analytics-muted: #9ca3af;
    --analytics-faint: #6b7280;
    --analytics-green: #4ecca3;
    --analytics-blue: #3498db;
    --analytics-purple: #9b59b6;
    --analytics-amber: #f39c12;
    --analytics-red: #e74c3c;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--analytics-bg);
    color: var(--analytics-text);
}

#analytics-section.hidden {
    display: none !important;
}

.analytics-appbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 16px;
    background: #111827;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    flex: 0 0 auto;
}

.analytics-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.analytics-logo {
    display: block;
    width: auto;
    height: 20px;
}

.analytics-back-btn {
    border: 1px solid rgba(255, 255, 255, .18);
    background: transparent;
    color: var(--analytics-muted);
    border-radius: 7px;
    padding: 5px 10px;
    font: 600 12px 'Inter', sans-serif;
    cursor: pointer;
}

.analytics-back-btn:hover,
.analytics-back-btn:focus {
    border-color: rgba(255, 255, 255, .42);
    color: var(--analytics-text);
    outline: none;
}

.analytics-appbar-title {
    color: var(--analytics-green);
    font-size: 13px;
    font-weight: 700;
}

.analytics-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 14px 16px 32px;
    background: var(--analytics-bg);
    min-height: calc(100vh - 37px);
}

#analytics-content {
    font-size: 13px;
}

.analytics-status {
    margin: 28px auto;
    max-width: 520px;
    padding: 34px 24px;
    text-align: center;
    background: var(--analytics-panel);
    border: 1px solid var(--analytics-line);
    border-radius: 8px;
    color: var(--analytics-muted);
}

.analytics-status .secondary-btn {
    margin-top: 12px;
}

.analytics-error {
    color: #fca5a5;
}

.analytics-period-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 12px;
    margin-bottom: 14px;
    padding: 10px;
    background: rgba(28, 35, 51, .78);
    border: 1px solid var(--analytics-line);
    border-radius: 8px;
}

.analytics-date-range,
.analytics-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.analytics-freshness {
    align-self: center;
    margin-left: auto;
    color: var(--analytics-muted);
    font-size: 12px;
}

.analytics-freshness.is-stale {
    color: var(--analytics-amber);
}

.analytics-actions {
    justify-content: flex-end;
}

.analytics-active-filters {
    grid-column: 1 / -1;
    min-height: 0;
}

.analytics-active-filters:empty {
    display: none;
}

.analytics-date-label {
    font-size: 11px;
    color: var(--analytics-muted);
    font-weight: 600;
}

.analytics-date-range::before {
    content: "Period:";
    color: var(--analytics-muted);
    font-size: 11px;
    font-weight: 600;
    margin-right: 2px;
}

.analytics-date-input {
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid var(--analytics-line);
    border-radius: 6px;
    background: var(--analytics-panel-deep);
    color: var(--analytics-text);
    font: 500 12px 'Inter', sans-serif;
    color-scheme: dark;
}

.analytics-date-input:focus {
    outline: 2px solid rgba(78, 204, 163, .65);
    outline-offset: -1px;
}

.analytics-period-buttons {
    display: flex;
    gap: 6px;
    margin-left: 2px;
}

.analytics-period-btn {
    min-height: 28px;
    padding: 4px 12px;
    border: 1px solid var(--analytics-line);
    border-radius: 6px;
    background: var(--analytics-panel);
    color: var(--analytics-muted);
    cursor: pointer;
    font: 700 12px 'Inter', sans-serif;
}

.analytics-period-btn:hover {
    color: var(--analytics-text);
    border-color: rgba(78, 204, 163, .55);
}

.analytics-period-btn.active {
    background: var(--analytics-green);
    border-color: var(--analytics-green);
    color: var(--analytics-bg);
}

#analytics-section .secondary-btn {
    width: auto;
    min-height: 28px;
    padding: 4px 12px;
    border: 1px solid rgba(78, 204, 163, .72);
    border-radius: 6px;
    background: var(--analytics-panel);
    color: var(--analytics-green);
    font: 700 12px 'Inter', sans-serif;
}

#analytics-section .secondary-btn:hover,
#analytics-section .secondary-btn:focus {
    background: rgba(78, 204, 163, .1);
    outline: none;
}

.analytics-kpi-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.analytics-kpi-tile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    background: var(--analytics-panel);
    border: 1px solid var(--analytics-line-soft);
    border-left: 3px solid var(--analytics-green);
    border-radius: 6px;
    padding: 6px 10px;
    text-align: center;
}

.analytics-kpi-tile--alert {
    border-left-color: var(--analytics-red);
}

.analytics-kpi-tile--button {
    cursor: pointer;
}

.analytics-kpi-tile--button:hover {
    border-color: rgba(78, 204, 163, .5);
}

.analytics-kpi-label {
    display: block;
    margin-bottom: 2px;
    color: var(--analytics-muted);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.analytics-kpi-value {
    display: block;
    color: #fff;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.analytics-panel {
    min-width: 0;
    background: var(--analytics-panel);
    border: 1px solid var(--analytics-line-soft);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}

.analytics-panel-title {
    margin: 0 0 8px;
    color: #d1d5db;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.analytics-panel-subtitle {
    margin: 0 0 6px;
    color: var(--analytics-muted);
    font-size: 11px;
}

.analytics-panel-subtitle--alert {
    color: #f87171;
}

.analytics-panel-divider {
    border: 0;
    border-top: 1px solid var(--analytics-line);
    margin: 10px 0;
}

.analytics-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 0;
}

.analytics-suggestion-section {
    margin-top: 0;
    padding: 8px;
    border: 2px dashed rgba(52, 152, 219, .75);
    border-radius: 8px;
}

.analytics-suggestion-section .analytics-panel {
    margin-bottom: 0;
}

.analytics-bar-row {
    display: grid;
    grid-template-columns: minmax(72px, 136px) minmax(80px, 1fr) minmax(38px, auto);
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}

.analytics-bar-label {
    min-width: 0;
    overflow: hidden;
    color: var(--analytics-text);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analytics-bar-track {
    overflow: hidden;
    width: 100%;
    height: 8px;
    background: var(--analytics-bg);
    border-radius: 3px;
}

.analytics-card-performance-row {
    grid-template-columns: minmax(120px, 1fr) minmax(38px, auto) minmax(92px, 42%);
}

.analytics-card-performance-row[data-analytics-card-link] {
    cursor: pointer;
}

.analytics-card-performance-row .analytics-bar-track {
    grid-column: 3;
    grid-row: 1;
}

.analytics-card-performance-row .analytics-bar-value {
    grid-column: 2;
}

.analytics-card-performance-row .analytics-bar-label {
    min-width: 0;
}

.analytics-card-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.analytics-card-pagination-btn {
    min-width: 28px;
    padding: 4px 8px;
    border: 1px solid var(--analytics-line);
    border-radius: 999px;
    background: var(--analytics-panel-deep);
    color: var(--analytics-muted);
    font-size: 11px;
    line-height: 1;
}

.analytics-card-pagination-btn.is-active {
    border-color: var(--analytics-blue);
    background: rgba(90, 95, 209, 0.12);
    color: var(--analytics-text);
}

.analytics-bar-fill {
    min-width: 2px;
    height: 100%;
    background: var(--analytics-green);
    border-radius: 3px;
}

.analytics-bar-fill--blue {
    background: var(--analytics-blue);
}

.analytics-bar-fill--green {
    background: #2ecc71;
}

.analytics-bar-value {
    color: var(--analytics-muted);
    font-size: 10px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.analytics-card-search {
    flex: 0 1 220px;
    max-width: 220px;
}

.analytics-card-search input {
    min-height: 30px;
    border-color: var(--analytics-line);
    background: var(--analytics-panel-deep);
    color: var(--analytics-text);
}

.analytics-card-search input::placeholder {
    color: var(--analytics-faint);
}

.analytics-card-search-results {
    background: var(--analytics-panel-deep);
    border-color: var(--analytics-line);
}

.analytics-card-search-results button {
    color: var(--analytics-text);
}

.analytics-card-search-results button:hover,
.analytics-card-search-results button[aria-selected="true"] {
    background: var(--analytics-panel);
}

#analytics-section .analytics-card-search {
    flex: 0 1 220px;
    max-width: 220px;
}

#analytics-section .analytics-card-search input,
#analytics-section .analytics-filters-popup input,
#analytics-section .analytics-filters-popup select {
    border-color: var(--analytics-line);
    background: var(--analytics-panel-deep);
    color: var(--analytics-text);
}

#analytics-section .analytics-card-search input:focus,
#analytics-section .analytics-filters-popup input:focus,
#analytics-section .analytics-filters-popup select:focus {
    outline: 2px solid rgba(78, 204, 163, .65);
    outline-offset: -1px;
}

#analytics-section .analytics-card-search-results,
#analytics-section .analytics-filters-popup {
    border-color: var(--analytics-line);
    background: var(--analytics-panel);
    color: var(--analytics-text);
}

#analytics-section .analytics-card-search-results button {
    color: var(--analytics-text);
}

#analytics-section .analytics-card-search-results button:hover,
#analytics-section .analytics-card-search-results button[aria-selected="true"] {
    background: var(--analytics-panel-deep);
}

#analytics-section .analytics-card-search-results span,
#analytics-section .analytics-filters-popup label,
#analytics-section .analytics-filters-popup-header p,
#analytics-section #filter-site-selected {
    color: var(--analytics-muted);
}

#analytics-section .analytics-filters-popup-header h3 {
    color: var(--analytics-text);
}

#analytics-section .analytics-filters-popup-close {
    color: var(--analytics-muted);
}

#analytics-section .analytics-filters-popup-close:hover {
    color: var(--analytics-text);
}

#analytics-section #filter-site-results {
    border-color: var(--analytics-line) !important;
    background: var(--analytics-panel-deep) !important;
}

#analytics-section #filter-site-results button {
    background: var(--analytics-panel-deep) !important;
    color: var(--analytics-text);
}

#analytics-section #filter-site-results button:hover {
    background: var(--analytics-panel) !important;
}

.analytics-single-card-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.analytics-single-card-stats div,
.analytics-single-card-note {
    background: var(--analytics-panel-deep);
    border: 1px solid var(--analytics-line);
    border-radius: 6px;
    padding: 10px;
}

.analytics-single-card-stats strong {
    display: block;
    color: #fff;
    font-size: 20px;
}

.analytics-single-card-stats span,
.analytics-single-card-note {
    color: var(--analytics-muted);
    font-size: 11px;
}

.analytics-featured-category-header,
.analytics-featured-category-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 100px 100px 70px;
    gap: 12px;
    align-items: center;
}

.analytics-featured-category-header {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--analytics-line);
    color: var(--analytics-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.analytics-featured-category-row {
    padding: 10px 0;
    border-bottom: 1px solid var(--analytics-line-soft);
    color: var(--analytics-text);
    font-size: 12px;
}

.analytics-featured-category-row span,
.analytics-featured-category-row strong:last-child {
    text-align: right;
}

.analytics-featured-category-row div span {
    display: block;
    margin-top: 2px;
    color: var(--analytics-muted);
    text-align: left;
}

.analytics-gap-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid var(--analytics-line-soft);
}

.analytics-gap-query {
    min-width: 0;
    overflow: hidden;
    color: var(--analytics-text);
    font-size: 11px;
    font-style: italic;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analytics-gap-count {
    flex: 0 0 auto;
    color: #f87171;
    font-size: 10px;
    white-space: nowrap;
}

.analytics-tag {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin: 3px;
    padding: 3px 9px;
    overflow: hidden;
    border: 1px solid rgba(78, 204, 163, .2);
    border-radius: 999px;
    background: rgba(78, 204, 163, .14);
    color: var(--analytics-green);
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analytics-friction-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.analytics-friction-tile {
    min-width: 0;
    padding: 9px;
    border: 1px solid var(--analytics-line-soft);
    border-radius: 5px;
    background: var(--analytics-panel-deep);
    cursor: pointer;
    text-align: center;
}

.analytics-friction-tile:hover,
.analytics-friction-tile:focus {
    border-color: rgba(243, 156, 18, .75);
    outline: none;
}

.analytics-friction-tile--alert {
    border-color: rgba(231, 76, 60, .25);
}

.analytics-friction-value {
    display: block;
    color: var(--analytics-amber);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.analytics-friction-tile--alert .analytics-friction-value {
    color: var(--analytics-red);
}

.analytics-friction-label {
    display: block;
    margin-top: 4px;
    color: var(--analytics-muted);
    font-size: 10px;
}

.analytics-friction-details {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid var(--analytics-line);
    color: var(--analytics-muted);
    font-size: 11px;
}

.analytics-friction-details:empty {
    display: none;
}

.analytics-friction-detail-title {
    margin-bottom: 5px;
    color: var(--analytics-text);
    font-weight: 800;
}

.analytics-friction-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 0;
    border-bottom: 1px solid var(--analytics-line-soft);
}

#analytics-map {
    height: 220px;
    overflow: hidden;
    border: 1px solid var(--analytics-line);
    border-radius: 6px;
    background: var(--analytics-panel-deep);
}

.analytics-map-popup {
    min-width: 180px;
    color: #111827;
    font-size: 12px;
}

.analytics-map-popup-title {
    margin-bottom: 6px;
    font-weight: 700;
}

.analytics-map-popup-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 3px 0;
}

.analytics-collection-card {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--analytics-line);
    border-radius: 6px;
    background: var(--analytics-panel-deep);
}

.analytics-collection-card-header,
.analytics-context-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.analytics-collection-card-header {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--analytics-line);
    font-size: 12px;
    font-weight: 800;
}

.analytics-collection-card-header span,
.analytics-context-row span {
    color: var(--analytics-muted);
    font-size: 10px;
    white-space: nowrap;
}

.analytics-context-group {
    margin-top: 10px;
}

.analytics-context-title {
    margin-bottom: 4px;
    color: var(--analytics-muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.analytics-context-row {
    padding: 4px 0;
    border-bottom: 1px solid var(--analytics-line-soft);
    font-size: 11px;
}

.analytics-card-link {
    min-width: 0;
    overflow: hidden;
    color: #9cc9ff;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analytics-card-link:hover {
    text-decoration: underline;
}

.analytics-empty-row {
    padding: 4px 0;
    color: var(--analytics-faint);
    font-size: 11px;
}

.analytics-plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.analytics-plan-tile {
    min-width: 0;
    padding: 9px;
    border: 1px solid var(--analytics-line-soft);
    border-radius: 5px;
    background: var(--analytics-panel-deep);
    text-align: center;
}

.analytics-plan-value {
    display: block;
    color: var(--analytics-blue);
    font-size: 19px;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.analytics-plan-label {
    display: block;
    margin-top: 4px;
    color: var(--analytics-muted);
    font-size: 10px;
}

@media (max-width: 1120px) {
    .analytics-kpi-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .analytics-container {
        padding: 10px;
    }

    .analytics-period-bar,
    .analytics-two-col {
        grid-template-columns: 1fr;
    }

    .analytics-actions {
        justify-content: flex-start;
    }

    .analytics-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .analytics-appbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .analytics-date-range,
    .analytics-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .analytics-date-range::before {
        margin-right: 0;
    }

    .analytics-date-input,
    .analytics-period-buttons,
    #analytics-section .secondary-btn {
        width: 100%;
    }

    .analytics-period-buttons {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .analytics-kpi-row,
    .analytics-plan-grid {
        grid-template-columns: 1fr;
    }

    .analytics-bar-row,
    .analytics-card-performance-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .analytics-bar-track,
    .analytics-card-performance-row .analytics-bar-track {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .analytics-card-performance-row .analytics-bar-value {
        grid-column: 2;
    }
}

/* Analytics Insights mockup styling */
#analytics-section.analytics-shell {
    --analytics-bg: #f2f3f7;
    --analytics-panel: #ffffff;
    --analytics-panel-deep: #f8f9fc;
    --analytics-line: #dde1ec;
    --analytics-line-soft: #eaecf3;
    --analytics-text: #1b1d31;
    --analytics-muted: #62667a;
    --analytics-faint: #9094a8;
    --analytics-green: #009a6c;
    --analytics-blue: #5a5fd1;
    --analytics-purple: #5a5fd1;
    --analytics-amber: #f3c400;
    --analytics-red: #b42318;
    background: var(--analytics-bg);
    color: var(--analytics-text);
}

#analytics-section .hidden {
    display: none !important;
}

#analytics-section.analytics-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .88), rgba(242, 243, 247, .94) 34%),
        radial-gradient(circle at 50% -12%, rgba(90, 95, 209, .1), transparent 34%);
}

#analytics-section .analytics-appbar {
    padding: 13px 28px;
    background: #ffffff;
    border-bottom: 1px solid var(--analytics-line);
    box-shadow: 0 1px 0 rgba(27, 29, 49, .02);
}

#analytics-section .analytics-brand {
    gap: 16px;
}

#analytics-section .analytics-logo {
    height: 24px;
}

#analytics-section .analytics-back-btn,
#analytics-section .secondary-btn {
    min-height: 38px;
    padding: 0 15px;
    border: 1px solid #cfd3df;
    border-radius: 12px;
    background: #ffffff;
    color: var(--analytics-text);
    font: 700 12px 'Inter', sans-serif;
    box-shadow: 0 1px 2px rgba(27, 29, 49, .04);
}

#analytics-section .analytics-back-btn:hover,
#analytics-section .analytics-back-btn:focus,
#analytics-section .secondary-btn:hover,
#analytics-section .secondary-btn:focus {
    border-color: var(--analytics-purple);
    color: var(--analytics-purple);
    background: #fbfbff;
    outline: none;
}

#analytics-section .analytics-appbar-title {
    color: var(--analytics-text);
    font-size: 14px;
    font-weight: 800;
}

#analytics-section .analytics-container {
    max-width: 1240px;
    min-height: calc(100vh - 51px);
    padding: 28px 24px 44px;
    background: transparent;
}

#analytics-section #analytics-content {
    position: relative;
    padding: 24px;
    border: 1px solid var(--analytics-line);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(27, 29, 49, .08);
    font-size: 13px;
}

#analytics-section #analytics-content.analytics-content-loading {
    opacity: .74;
}

#analytics-section #analytics-content.analytics-content-loading .analytics-kpi-value,
#analytics-section #analytics-content.analytics-content-loading .analytics-plan-value,
#analytics-section #analytics-content.analytics-content-loading .analytics-friction-value {
    color: var(--analytics-faint);
}

#analytics-section #analytics-loading {
    margin: 0 0 12px;
    max-width: none;
    padding: 10px 14px;
    text-align: left;
    border-radius: 10px;
    box-shadow: none;
}

#analytics-section #analytics-content::before {
    content: "Insights";
    display: block;
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--analytics-amber);
    width: max-content;
    color: var(--analytics-purple);
    font: 800 24px/1.1 'Inter', sans-serif;
}

#analytics-section .analytics-status {
    background: #ffffff;
    border-color: var(--analytics-line);
    border-radius: 16px;
    color: var(--analytics-muted);
    box-shadow: 0 18px 48px rgba(27, 29, 49, .08);
}

#analytics-section .analytics-error {
    color: var(--analytics-red);
}

#analytics-section .analytics-period-bar {
    align-items: start;
    margin-bottom: 22px;
    padding: 0 0 20px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--analytics-line-soft);
    border-radius: 0;
}

#analytics-section .analytics-card-insights-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    margin: 0 0 24px;
}

#analytics-section .analytics-card-insights-header h2 {
    margin: 0 0 6px;
    color: var(--analytics-text);
    font: 850 26px/1.08 'Outfit', 'Inter', sans-serif;
}

#analytics-section .analytics-card-insights-header p {
    margin: 0;
}

#analytics-section #analytics-card-insights-meta {
    color: var(--analytics-muted);
    font-size: 14px;
}

#analytics-section .analytics-card-insights-summary {
    max-width: 780px;
    color: var(--analytics-muted);
    font: 400 18px/1.55 'Inter', sans-serif;
}

#analytics-section .analytics-card-insights-summary::first-letter {
    color: inherit;
}

#analytics-section .analytics-date-range::before {
    content: "Period";
    color: var(--analytics-muted);
    font-size: 12px;
}

#analytics-section .analytics-date-label {
    color: var(--analytics-muted);
    font-size: 12px;
}

#analytics-section .analytics-date-input,
#analytics-section .analytics-card-search input,
#analytics-section .analytics-filters-popup input,
#analytics-section .analytics-filters-popup select {
    min-height: 38px;
    border: 1px solid #cfd3df;
    border-radius: 12px;
    background: #ffffff;
    color: var(--analytics-text);
    color-scheme: light;
    font: 600 12px 'Inter', sans-serif;
}

#analytics-section .analytics-date-input:focus,
#analytics-section .analytics-card-search input:focus,
#analytics-section .analytics-filters-popup input:focus,
#analytics-section .analytics-filters-popup select:focus {
    border-color: var(--analytics-purple);
    outline: 3px solid rgba(90, 95, 209, .15);
    outline-offset: 0;
}

#analytics-section .analytics-date-range {
    position: relative;
}

#analytics-section .analytics-calendar-btn {
    min-height: 38px;
    border: 1px solid #cfd3df;
    border-radius: 12px;
    background: #fff;
    color: var(--analytics-text);
    font: 700 12px 'Inter', sans-serif;
    padding: 8px 12px;
    cursor: pointer;
}

#analytics-section .analytics-calendar-btn:focus {
    border-color: var(--analytics-purple);
    outline: 3px solid rgba(90, 95, 209, .15);
}

#analytics-section .analytics-calendar-popover {
    position: absolute;
    z-index: 80;
    top: calc(100% + 8px);
    left: 0;
    width: min(322px, calc(100vw - 32px));
    padding: 12px;
    border: 1px solid #d8dce8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(17, 24, 39, .18);
}

#analytics-section .analytics-calendar-head,
#analytics-section .analytics-calendar-weekdays,
#analytics-section .analytics-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

#analytics-section .analytics-calendar-head {
    grid-template-columns: 32px 1fr 32px;
    align-items: center;
    margin-bottom: 10px;
}

#analytics-section .analytics-calendar-head strong {
    text-align: center;
    font: 700 13px 'Inter', sans-serif;
}

#analytics-section .analytics-calendar-head button {
    width: 32px;
    height: 32px;
    border: 1px solid #d8dce8;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

#analytics-section .analytics-calendar-weekdays {
    margin-bottom: 4px;
    color: var(--analytics-muted);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
}

#analytics-section .analytics-calendar-day {
    aspect-ratio: 1;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #fff;
    color: var(--analytics-text);
    font: 700 12px 'Inter', sans-serif;
    cursor: pointer;
}

#analytics-section .analytics-calendar-day.is-outside {
    color: #a5adbd;
}

#analytics-section .analytics-calendar-day.is-range {
    background: rgba(90, 95, 209, .12);
}

#analytics-section .analytics-calendar-day.is-start,
#analytics-section .analytics-calendar-day.is-end {
    background: var(--analytics-purple);
    color: #fff;
}

#analytics-section .analytics-calendar-day.is-disabled {
    background: #eef0f5;
    color: #a0a6b4;
    cursor: not-allowed;
    text-decoration: line-through;
}

#analytics-section .analytics-period-buttons {
    gap: 0;
    margin-left: 6px;
    padding: 2px;
    border: 1px solid #cfd3df;
    border-radius: 14px;
    background: #ffffff;
}

#analytics-section .analytics-period-btn {
    min-height: 34px;
    padding: 0 17px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--analytics-muted);
    font: 800 12px 'Inter', sans-serif;
}

#analytics-section .analytics-period-btn:hover,
#analytics-section .analytics-period-btn.active {
    background: #f5f5ff;
    color: var(--analytics-purple);
}

#analytics-section .analytics-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 2px;
}

#analytics-section .analytics-active-filters:empty {
    display: none;
}

#analytics-section .analytics-summary-empty {
    margin: 10px 0 18px;
    padding: 24px;
    border: 1px solid var(--analytics-line);
    border-radius: 14px;
    background: #ffffff;
}

#analytics-section .analytics-summary-empty h3 {
    margin: 0 0 6px;
    color: var(--analytics-text);
    font: 850 20px/1.2 'Outfit', 'Inter', sans-serif;
}

#analytics-section .analytics-summary-empty p {
    max-width: 58ch;
    margin: 0 0 16px;
    color: var(--analytics-muted);
    font-size: 14px;
    line-height: 1.45;
}

#analytics-section .analytics-kpi-row {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

#analytics-section .analytics-single-card-mode .analytics-kpi-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

#analytics-section .analytics-single-card-mode .analytics-kpi-tile {
    min-height: 72px;
    padding: 8px 12px;
}

#analytics-section .analytics-single-card-mode .analytics-kpi-label {
    font-size: 10px;
    margin-bottom: 3px;
}

#analytics-section .analytics-single-card-mode .analytics-kpi-value {
    font-size: 21px;
}

#analytics-section .analytics-single-card-mode .analytics-kpi-delta {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#analytics-section .analytics-kpi-tile {
    min-height: 76px;
    padding: 8px 12px;
    border: 1px solid var(--analytics-line);
    border-left: 1px solid var(--analytics-line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: none;
}

#analytics-section .analytics-kpi-tile:first-child,
#analytics-section .analytics-kpi-tile--button {
    border: 2px solid var(--analytics-purple);
    box-shadow: inset 0 4px 0 var(--analytics-purple);
}

#analytics-section .analytics-kpi-tile--alert {
    border-color: #f0c4bf;
}

#analytics-section .analytics-kpi-label {
    margin-bottom: 3px;
    color: var(--analytics-muted);
    font-size: 10px;
    letter-spacing: 0;
    line-height: 1.3;
    text-transform: uppercase;
}

#analytics-section .analytics-kpi-value {
    color: var(--analytics-text);
    font-size: 20px;
    font-weight: 850;
    line-height: 1;
}

#analytics-section .analytics-kpi-tile:first-child .analytics-kpi-value,
#analytics-section .analytics-kpi-tile--button .analytics-kpi-value {
    color: var(--analytics-purple);
}

#analytics-section .analytics-kpi-tile--alert .analytics-kpi-value {
    color: var(--analytics-red);
}

#analytics-section .analytics-kpi-delta {
    display: block;
    margin-top: 7px;
    color: var(--analytics-muted);
    font: 600 13px/1.25 'Inter', sans-serif;
}

#analytics-section .analytics-kpi-delta--up {
    color: var(--analytics-green);
}

#analytics-section .analytics-kpi-delta--down {
    color: var(--analytics-red);
}

#analytics-section .analytics-kpi-delta--flat {
    color: var(--analytics-muted);
}

#analytics-section .analytics-kpi-delta:empty {
    display: none;
}

#analytics-section .analytics-card-insights-callout {
    width: fit-content;
    max-width: 100%;
    margin: 2px 0 18px;
    padding: 10px 18px;
    border: 1px solid var(--analytics-line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--analytics-muted);
    font: 700 14px/1.35 'Inter', sans-serif;
}

#analytics-section .analytics-card-insights-callout::first-letter {
    color: inherit;
}

#analytics-section .analytics-panel {
    margin-bottom: 14px;
    padding: 22px;
    border: 1px solid var(--analytics-line);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: none;
}

#analytics-section .analytics-single-card-mode>.analytics-panel {
    padding: 26px;
}

#analytics-section .analytics-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

#analytics-section .analytics-metric-ref {
    color: var(--analytics-purple);
    font: 800 12px/1.2 'Inter', sans-serif;
}

#analytics-section .analytics-panel-title {
    margin-bottom: 12px;
    color: var(--analytics-text);
    font-size: 18px;
    font-weight: 850;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none;
}

#analytics-section .analytics-single-card-mode canvas#analytics-trend-chart {
    min-height: 320px;
}

#analytics-section .analytics-card-insights-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

#analytics-section .analytics-card-insights-grid .analytics-panel {
    margin-bottom: 0;
}

#analytics-section .analytics-funnel-metric {
    display: grid;
    gap: 7px;
    margin-top: 14px;
}

#analytics-section .analytics-funnel-metric div,
#analytics-section .analytics-mini-list div,
#analytics-section .analytics-journey-column div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
}

#analytics-section .analytics-funnel-metric span,
#analytics-section .analytics-mini-list span,
#analytics-section .analytics-journey-column span,
#analytics-section .analytics-split-metrics span {
    color: var(--analytics-muted);
}

#analytics-section .analytics-funnel-metric strong,
#analytics-section .analytics-mini-list strong,
#analytics-section .analytics-journey-column em,
#analytics-section .analytics-split-metrics strong {
    color: var(--analytics-text);
    font-style: normal;
    font-weight: 850;
}

#analytics-section .analytics-funnel-metric i {
    display: block;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef0f6;
}

#analytics-section .analytics-funnel-metric b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--analytics-purple);
}

#analytics-section .analytics-funnel-metric small {
    color: var(--analytics-muted);
    font-size: 12px;
}

#analytics-section .analytics-split-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

#analytics-section .analytics-split-metrics div {
    min-width: 0;
    padding: 13px;
    border: 1px solid var(--analytics-line-soft);
    border-radius: 10px;
    background: var(--analytics-panel-deep);
}

#analytics-section .analytics-split-metrics span,
#analytics-section .analytics-split-metrics strong {
    display: block;
}

#analytics-section .analytics-split-metrics span {
    margin-bottom: 8px;
    font-size: 12px;
}

#analytics-section .analytics-split-metrics strong {
    font-size: 22px;
}

#analytics-section .analytics-mini-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

#analytics-section .analytics-mini-list div,
#analytics-section .analytics-journey-column div {
    padding-bottom: 9px;
    border-bottom: 1px solid var(--analytics-line-soft);
}

#analytics-section .analytics-journey-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

#analytics-section .analytics-journey-column {
    min-width: 0;
}

#analytics-section .analytics-journey-column>strong {
    display: block;
    margin-bottom: 10px;
    color: var(--analytics-text);
}

#analytics-section .analytics-journey-column p {
    margin: 0;
    color: var(--analytics-muted);
    font-size: 12px;
}

#analytics-section .analytics-heatmap-grid {
    display: grid;
    grid-template-columns: 52px repeat(7, minmax(24px, 1fr));
    gap: 5px;
    align-items: center;
    margin-top: 16px;
}

#analytics-section .analytics-heatmap-grid b {
    color: var(--analytics-muted);
    font-size: 11px;
    text-align: center;
}

#analytics-section .analytics-heatmap-grid i {
    display: block;
    min-height: 25px;
    border-radius: 5px;
    background: rgba(90, 95, 209, calc(.08 + (var(--heat) * .72)));
}

#analytics-section .analytics-empty-row--panel {
    padding: 16px;
    border: 1px dashed var(--analytics-line);
    border-radius: 10px;
    background: var(--analytics-panel-deep);
}

#analytics-section .analytics-panel-subtitle {
    margin-bottom: 8px;
    color: var(--analytics-muted);
    font-size: 13px;
}

#analytics-section .analytics-panel-subtitle--alert,
#analytics-section .analytics-gap-count {
    color: var(--analytics-red);
}

#analytics-section .analytics-panel-divider {
    border-top-color: var(--analytics-line-soft);
    margin: 15px 0;
}

#analytics-section .analytics-two-col {
    gap: 14px;
}

#analytics-section .analytics-suggestion-section {
    padding: 0;
    border: 0;
    border-radius: 0;
}

#analytics-section .analytics-bar-row {
    gap: 10px;
    margin-bottom: 9px;
}

#analytics-section .analytics-bar-label,
#analytics-section .analytics-gap-query {
    color: var(--analytics-text);
    font-size: 12px;
}

#analytics-section .analytics-bar-value {
    color: var(--analytics-muted);
    font-size: 11px;
}

#analytics-section .analytics-bar-track {
    height: 10px;
    border-radius: 999px;
    background: #eef0f6;
}

#analytics-section .analytics-bar-fill {
    border-radius: 999px;
    background: var(--analytics-purple);
}

#analytics-section .analytics-bar-fill--blue {
    background: #6f73df;
}

#analytics-section .analytics-bar-fill--green {
    background: var(--analytics-green);
}

#analytics-section .analytics-card-search {
    flex-basis: 240px;
    max-width: 240px;
}

#analytics-section .analytics-card-search input::placeholder {
    color: var(--analytics-faint);
}

#analytics-section .analytics-card-search-results,
#analytics-section .analytics-filters-popup {
    border: 1px solid var(--analytics-line);
    border-radius: 16px;
    background: #ffffff;
    color: var(--analytics-text);
    box-shadow: 0 18px 44px rgba(27, 29, 49, .12);
}

#analytics-section .analytics-card-search-results button,
#analytics-section #filter-site-results button {
    background: #ffffff !important;
    color: var(--analytics-text);
}

#analytics-section .analytics-card-search-results button:hover,
#analytics-section .analytics-card-search-results button[aria-selected="true"],
#analytics-section #filter-site-results button:hover {
    background: #f5f5ff !important;
    color: var(--analytics-purple);
}

#analytics-section .analytics-card-search-results span,
#analytics-section .analytics-filters-popup label,
#analytics-section .analytics-filters-popup-header p,
#analytics-section #filter-site-selected {
    color: var(--analytics-muted);
}

#analytics-section .analytics-filters-popup-header h3 {
    color: var(--analytics-text);
}

#analytics-section .analytics-filters-popup-close {
    color: var(--analytics-muted);
}

#analytics-section .analytics-filters-popup-close:hover {
    color: var(--analytics-text);
}

#analytics-section #filter-site-results {
    border-color: var(--analytics-line) !important;
    border-radius: 12px;
    background: #ffffff !important;
}

#analytics-section .analytics-single-card-stats div,
#analytics-section .analytics-single-card-note,
#analytics-section .analytics-collection-card,
#analytics-section .analytics-friction-tile,
#analytics-section .analytics-plan-tile {
    border: 1px solid var(--analytics-line-soft);
    border-radius: 12px;
    background: var(--analytics-panel-deep);
}

#analytics-section .analytics-single-card-stats strong,
#analytics-section .analytics-friction-detail-title {
    color: var(--analytics-text);
}

#analytics-section .analytics-featured-category-header {
    border-bottom-color: var(--analytics-line);
    color: var(--analytics-muted);
    letter-spacing: 0;
}

#analytics-section .analytics-featured-category-row,
#analytics-section .analytics-gap-row,
#analytics-section .analytics-friction-detail-row,
#analytics-section .analytics-context-row {
    border-bottom-color: var(--analytics-line-soft);
    color: var(--analytics-text);
}

#analytics-section .analytics-featured-category-row div span,
#analytics-section .analytics-single-card-stats span,
#analytics-section .analytics-single-card-note,
#analytics-section .analytics-friction-label,
#analytics-section .analytics-plan-label,
#analytics-section .analytics-collection-card-header span,
#analytics-section .analytics-context-row span,
#analytics-section .analytics-context-title,
#analytics-section .analytics-friction-details,
#analytics-section .analytics-empty-row {
    color: var(--analytics-muted);
}

#analytics-section .analytics-tag {
    margin: 0;
    padding: 6px 11px;
    border: 1px solid #d9dcfb;
    border-radius: 999px;
    background: #f7f7ff;
    color: var(--analytics-purple);
    font-size: 12px;
    font-weight: 700;
}

#analytics-section .analytics-friction-tile:hover,
#analytics-section .analytics-friction-tile:focus {
    border-color: var(--analytics-purple);
    outline: 3px solid rgba(90, 95, 209, .12);
}

#analytics-section .analytics-friction-value,
#analytics-section .analytics-plan-value {
    color: var(--analytics-purple);
}

#analytics-section .analytics-friction-tile--alert .analytics-friction-value {
    color: var(--analytics-red);
}

#analytics-section .analytics-card-link {
    color: var(--analytics-purple);
}

#analytics-section #analytics-map {
    height: 250px;
    border-color: var(--analytics-line);
    border-radius: 14px;
    background: #f7f8fc;
}

@media (max-width: 1120px) {
    #analytics-section .analytics-kpi-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #analytics-section .analytics-single-card-mode .analytics-kpi-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    #analytics-section .analytics-card-insights-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    #analytics-section .analytics-container {
        padding: 16px 12px 28px;
    }

    #analytics-section #analytics-content {
        padding: 18px;
    }

    #analytics-section .analytics-period-bar,
    #analytics-section .analytics-two-col {
        grid-template-columns: 1fr;
    }

    #analytics-section .analytics-card-insights-summary {
        font-size: 16px;
    }

    #analytics-section .analytics-actions {
        justify-content: flex-start;
    }

    #analytics-section .analytics-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    #analytics-section .analytics-appbar {
        align-items: stretch;
        padding: 12px 16px;
    }

    #analytics-section .analytics-brand {
        justify-content: space-between;
    }

    #analytics-section .analytics-date-range,
    #analytics-section .analytics-actions {
        align-items: stretch;
        flex-direction: column;
    }

    #analytics-section .analytics-date-input,
    #analytics-section .analytics-period-buttons,
    #analytics-section .secondary-btn,
    #analytics-section .analytics-card-search {
        width: 100%;
        max-width: none;
    }

    #analytics-section .analytics-kpi-row,
    #analytics-section .analytics-single-card-mode .analytics-kpi-row,
    #analytics-section .analytics-split-metrics,
    #analytics-section .analytics-journey-columns,
    #analytics-section .analytics-plan-grid {
        grid-template-columns: 1fr;
    }

    #analytics-section .analytics-heatmap-grid {
        grid-template-columns: 42px repeat(7, minmax(18px, 1fr));
        gap: 3px;
    }
}