﻿:root {
    --primary: #0f766e;
    --primary-rgb: 15, 118, 110;
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --topbar-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --topbar-height: 64px;
    --radius: 0.375rem;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 4px 12px rgba(15, 23, 42, 0.1);
    --control-height: 2rem;
    --control-padding-y: 0.25rem;
    --control-padding-x: 0.65rem;
    --control-font-size: 0.8125rem;
}

[data-theme="dark"] {
    --body-bg: #0f172a;
    --card-bg: #1e293b;
    --sidebar-bg: #1e293b;
    --topbar-bg: #1e293b;
    --border-color: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-accent="purple"] { --primary: #8b5cf6; --primary-rgb: 139, 92, 246; }
[data-accent="green"] { --primary: #22c55e; --primary-rgb: 34, 197, 94; }
[data-accent="orange"] { --primary: #f97316; --primary-rgb: 249, 115, 22; }
[data-accent="red"] { --primary: #ef4444; --primary-rgb: 239, 68, 68; }
[data-accent="cyan"] { --primary: #06b6d4; --primary-rgb: 6, 182, 212; }
[data-accent="teal"] { --primary: #0f766e; --primary-rgb: 15, 118, 110; }
[data-accent="blue"] { --primary: #3b82f6; --primary-rgb: 59, 130, 246; }

[data-sidebar="dark"] .admin-sidebar { --sidebar-bg: #0f172a; }
[data-sidebar="dark"] .admin-sidebar .nav-link { color: #94a3b8; }
[data-sidebar="dark"] .admin-sidebar .nav-link:hover,
[data-sidebar="dark"] .admin-sidebar .nav-link.active { color: #fff; background: rgba(var(--primary-rgb), 0.15); }

* { box-sizing: border-box; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.admin-wrapper { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, transform 0.25s ease;
    overflow: hidden;
}

.admin-sidebar.collapsed { width: var(--sidebar-collapsed-width); }
.admin-sidebar.compact .nav-link span,
.admin-sidebar.collapsed .nav-link span,
.admin-sidebar.collapsed .sidebar-brand-text,
.admin-sidebar.collapsed .nav-section-title,
.admin-sidebar.collapsed .nav-badge,
.admin-sidebar.collapsed .nav-chevron { display: none; }

.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--border-color);
    gap: 0.75rem;
    flex-shrink: 0;
}
.sidebar-brand-icon {
    width: 36px; height: 36px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 1rem;
    flex-shrink: 0;
}
.sidebar-brand-icon.sidebar-brand-image {
    object-fit: cover;
    background: transparent;
    padding: 0;
}
.sidebar-brand-text { font-weight: 700; font-size: 1.125rem; color: var(--text-primary); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 1rem 0.75rem; }
.nav-section-title {
    font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-secondary);
    padding: 0.75rem 0.75rem 0.375rem; margin-top: 0.5rem;
}
.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.625rem 0.75rem; border-radius: var(--radius);
    color: var(--text-secondary); text-decoration: none;
    transition: all 0.15s; font-weight: 500; margin-bottom: 2px;
}
.sidebar-nav .nav-link i { font-size: 1.125rem; width: 1.25rem; text-align: center; flex-shrink: 0; }
.sidebar-nav .nav-link:hover { background: rgba(var(--primary-rgb), 0.08); color: var(--primary); }
.sidebar-nav .nav-link.active { background: rgba(var(--primary-rgb), 0.12); color: var(--primary); }
.nav-badge { margin-left: auto; font-size: 0.6875rem; }
.nav-submenu { padding-left: 2.5rem; }
.nav-submenu .nav-link { padding: 0.5rem 0.75rem; font-size: 0.8125rem; }

.admin-main {
    flex: 1; margin-left: var(--sidebar-width);
    display: flex; flex-direction: column; min-height: 100vh;
    transition: margin-left 0.25s ease;
}
.admin-sidebar.collapsed ~ .admin-main,
body.sidebar-collapsed .admin-main { margin-left: var(--sidebar-collapsed-width); }

.admin-topbar {
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center;
    padding: 0 1.5rem; gap: 1rem;
    position: sticky; top: 0; z-index: 1030;
}
.topbar-toggle {
    background: none; border: none; color: var(--text-secondary);
    font-size: 1.25rem; padding: 0.375rem; border-radius: var(--radius); cursor: pointer;
}
.topbar-toggle:hover { background: rgba(var(--primary-rgb), 0.08); color: var(--primary); }
.topbar-search { flex: 1; max-width: 320px; }
.topbar-search .form-control {
    background: var(--body-bg); border-color: var(--border-color);
    border-radius: 2rem; padding-left: 2.5rem; font-size: 0.8125rem;
}
.topbar-search .search-icon {
    position: absolute; left: 0.875rem; top: 50%; transform: translateY(-50%);
    color: var(--text-secondary);
}
.topbar-actions { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }
.topbar-btn {
    background: none; border: none; color: var(--text-secondary);
    width: 38px; height: 38px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.125rem; cursor: pointer; position: relative;
}
.topbar-btn:hover { background: rgba(var(--primary-rgb), 0.08); color: var(--primary); }
.topbar-btn .badge-dot {
    position: absolute; top: 6px; right: 6px;
    width: 8px; height: 8px; background: #ef4444;
    border-radius: 50%; border: 2px solid var(--topbar-bg);
}
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
}

.admin-content { flex: 1; padding: 1.5rem; }
.admin-footer {
    padding: 1rem 1.5rem; border-top: 1px solid var(--border-color);
    color: var(--text-secondary); font-size: 0.8125rem;
}

.admin-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.admin-card .card-header {
    background: transparent; border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem; font-weight: 600; font-size: 0.875rem;
}
.admin-card .card-body { padding: 0.85rem 1rem; }

.stat-card {
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: var(--radius); padding: 1.25rem;
    box-shadow: var(--shadow); height: 100%;
    display: flex; flex-direction: column;
}
.stat-card-icon {
    width: 48px; height: 48px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; margin-bottom: 1rem;
}
.stat-card-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.stat-card-label { color: var(--text-secondary); font-size: 0.8125rem; margin-bottom: 0.5rem; }
.stat-card-change { font-size: 0.8125rem; font-weight: 500; }
.stat-card-change.positive { color: #22c55e; }
.stat-card-change.negative { color: #ef4444; }

.page-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.page-subtitle { color: var(--text-secondary); margin: 0.25rem 0 0; }

.table-admin { margin: 0; font-size: 0.8125rem; }
.table-admin th {
    font-size: 0.6875rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.03em; color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color); padding: 0.45rem 0.65rem;
    background: var(--body-bg); white-space: nowrap;
}
.table-admin td { padding: 0.4rem 0.65rem; vertical-align: middle; border-color: var(--border-color); }
.table-admin .user-avatar { width: 24px !important; height: 24px !important; }
.table-responsive { border-radius: var(--radius); border: 1px solid var(--border-color); }

.badge-status { font-weight: 500; padding: 0.2em 0.5em; border-radius: 2rem; font-size: 0.6875rem; }

.table-actions { gap: 0.2rem !important; }
.table-actions .table-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--control-height);
    height: var(--control-height);
    min-width: var(--control-height);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    padding: 0;
    font-size: 0.8125rem;
    line-height: 1;
}

.table-actions .table-action-btn:hover {
    background: var(--body-bg);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.table-actions .table-action-secondary {
    color: var(--text-secondary);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border-color: var(--border-color);
    padding: 0.4rem 0.85rem;
    font-size: var(--control-font-size);
    min-height: var(--control-height);
}

/* Shared control height */
.btn,
.form-control,
.form-select {
    min-height: var(--control-height);
    height: var(--control-height);
    padding: var(--control-padding-y) var(--control-padding-x);
    font-size: var(--control-font-size);
    line-height: 1.25;
    border-radius: var(--radius);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.btn.btn-sm,
.btn-group-sm > .btn {
    min-height: 1.75rem;
    height: 1.75rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
}

.btn.btn-lg,
.btn-group-lg > .btn {
    min-height: 2.5rem;
    height: 2.5rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.9375rem;
}

textarea.form-control {
    height: auto;
    min-height: 5rem;
}

/* DataTables */
.dataTables_wrapper .row {
    --bs-gutter-y: 0.5rem;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--text-primary);
    height: var(--control-height);
    min-height: var(--control-height);
    padding: var(--control-padding-y) var(--control-padding-x);
    font-size: var(--control-font-size);
}

.dataTables_wrapper .dataTables_length select {
    width: auto;
    display: inline-block;
    padding-right: 1.75rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding-top: 0.35rem !important;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 0.35rem !important;
}

.dataTables_wrapper .dataTables_paginate .pagination {
    margin: 0;
    gap: 0.25rem;
    --bs-pagination-padding-x: 0.5rem;
    --bs-pagination-padding-y: 0;
    --bs-pagination-font-size: 0.75rem;
    --bs-pagination-color: var(--text-secondary);
    --bs-pagination-bg: var(--card-bg);
    --bs-pagination-border-width: 1px;
    --bs-pagination-border-color: var(--border-color);
    --bs-pagination-border-radius: var(--radius);
    --bs-pagination-hover-color: var(--primary);
    --bs-pagination-hover-bg: rgba(var(--primary-rgb), 0.08);
    --bs-pagination-hover-border-color: var(--primary);
    --bs-pagination-focus-color: var(--primary);
    --bs-pagination-focus-bg: rgba(var(--primary-rgb), 0.08);
    --bs-pagination-focus-box-shadow: none;
    --bs-pagination-active-color: #fff;
    --bs-pagination-active-bg: var(--primary);
    --bs-pagination-active-border-color: var(--primary);
    --bs-pagination-disabled-color: var(--text-secondary);
    --bs-pagination-disabled-bg: var(--card-bg);
    --bs-pagination-disabled-border-color: var(--border-color);
}

.dataTables_wrapper .dataTables_paginate .page-item {
    margin: 0;
}

.dataTables_wrapper .dataTables_paginate .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--control-height);
    height: var(--control-height);
    padding: 0 0.5rem;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1;
    box-shadow: none;
    outline: none;
}

.dataTables_wrapper .dataTables_paginate .page-item:not(:first-child) .page-link {
    margin-left: 0;
}

.dataTables_wrapper .dataTables_paginate .page-link:hover,
.dataTables_wrapper .dataTables_paginate .page-link:focus {
    z-index: 1;
    background: rgba(var(--primary-rgb), 0.08);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: none;
    outline: none;
}

.dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
    z-index: 2;
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-secondary);
    opacity: 0.55;
}

/* Legacy DataTables button markup fallback */
.dataTables_wrapper .dataTables_paginate > .paginate_button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: var(--control-height);
    height: var(--control-height);
    padding: 0 0.5rem !important;
    margin: 0 0.125rem !important;
    border-radius: var(--radius) !important;
    border: 1px solid var(--border-color) !important;
    background: var(--card-bg) !important;
    color: var(--text-secondary) !important;
    font-size: 0.75rem !important;
    line-height: 1 !important;
    box-shadow: none !important;
}

.dataTables_wrapper .dataTables_paginate > .paginate_button:hover:not(.disabled):not(.current) {
    background: rgba(var(--primary-rgb), 0.08) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.dataTables_wrapper .dataTables_paginate > .paginate_button.current {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

.dataTables_processing {
    top: 50% !important;
    left: 50% !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.dt-loader {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-width: 7.5rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(6px);
}

[data-theme="dark"] .dt-loader {
    background: rgba(30, 41, 59, 0.94);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.dt-loader-ring {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 2px solid rgba(var(--primary-rgb), 0.18);
    border-top-color: var(--primary);
    animation: dt-loader-spin 0.7s linear infinite;
}

.dt-loader-label {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

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

.dataTables_wrapper.processing .table-admin,
.dataTables_wrapper.processing table.dataTable {
    opacity: 0.45;
    transition: opacity 0.15s ease;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    background: var(--card-bg);
    border-color: var(--border-color) var(--border-color) var(--card-bg);
}

/* Bordered tabs + colored border */
.nav-tabs.nav-bordered {
    border-bottom: 2px solid var(--border-color);
}
.nav-tabs.nav-bordered .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    border-radius: 0;
    background: transparent;
    color: var(--text-secondary);
}
.nav-tabs.nav-bordered .nav-link:hover,
.nav-tabs.nav-bordered .nav-link:focus {
    border-color: transparent;
    color: var(--primary);
    background: transparent;
}
.nav-tabs.nav-bordered .nav-link.active {
    background: transparent;
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.nav-tabs.nav-bordered-primary {
    border-bottom-color: color-mix(in srgb, var(--primary) 25%, var(--border-color));
}
.nav-tabs.nav-bordered-primary .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.badge-active { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.badge-inactive { background: rgba(100, 116, 139, 0.12); color: #64748b; }

.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 85%, black); border-color: color-mix(in srgb, var(--primary) 85%, black); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.text-primary { color: var(--primary) !important; }
.bg-primary-subtle { background: rgba(var(--primary-rgb), 0.12) !important; color: var(--primary) !important; }

.theme-customizer {
    position: fixed; top: 0; right: -320px; width: 320px; height: 100vh;
    background: var(--card-bg); border-left: 1px solid var(--border-color);
    z-index: 1050; transition: right 0.3s ease; overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.theme-customizer.open { right: 0; }
.customizer-header {
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}
.customizer-body { padding: 1.25rem; }
.customizer-section { margin-bottom: 1.5rem; }
.customizer-section h6 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin-bottom: 0.75rem; }
.color-swatch {
    width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent;
    cursor: pointer; transition: transform 0.15s;
}
.color-swatch:hover, .color-swatch.active { transform: scale(1.1); border-color: var(--text-primary); }

.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 1035;
}
.sidebar-overlay.show { display: block; }

.activity-timeline { position: relative; padding-left: 1.5rem; }
.activity-item { position: relative; padding-bottom: 1.25rem; }
.activity-item::before {
    content: ''; position: absolute; left: -1.5rem; top: 0.375rem;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--primary); border: 2px solid var(--card-bg);
}
.activity-item::after {
    content: ''; position: absolute; left: calc(-1.5rem + 4px); top: 1rem;
    width: 2px; height: calc(100% - 0.5rem); background: var(--border-color);
}
.activity-item:last-child::after { display: none; }

.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-state i { font-size: 3rem; color: var(--text-secondary); opacity: 0.5; }
.empty-state h5 { margin-top: 1rem; }

.auth-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--body-bg) 0%, color-mix(in srgb, var(--primary) 8%, var(--body-bg)) 100%);
    padding: 1.5rem;
}
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: calc(var(--radius) * 1.5); box-shadow: var(--shadow-lg);
    padding: 2rem;
}

[data-layout="boxed"] .admin-content { max-width: 1400px; margin: 0 auto; width: 100%; }
[data-direction="rtl"] { direction: rtl; }
[data-direction="rtl"] .admin-sidebar { left: auto; right: 0; }
[data-direction="rtl"] .admin-main { margin-left: 0; margin-right: var(--sidebar-width); }

.form-control, .form-select {
    background: var(--card-bg); border-color: var(--border-color); color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary); box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.15);
}

.dropdown-menu { background: var(--card-bg); border-color: var(--border-color); }
.dropdown-item { color: var(--text-primary); }
.dropdown-item:hover { background: rgba(var(--primary-rgb), 0.08); color: var(--primary); }

.notification-item { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); }
.notification-item.unread { background: rgba(var(--primary-rgb), 0.04); }
.notification-dropdown { width: 360px; max-height: 400px; overflow-y: auto; }

@media (max-width: 991.98px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.mobile-open { transform: translateX(0); }
    .admin-main { margin-left: 0 !important; }
    .topbar-search { display: none; }
}
@media (max-width: 575.98px) {
    .admin-content { padding: 1rem; }
    .stat-card-value { font-size: 1.375rem; }
}

/* Theme workspace */
.theme-preview-card { position: sticky; top: 0.75rem; }
.theme-preview-card .card-body { padding: 0.875rem 1rem; }
.theme-preview-frame {
    display: block;
    width: 100%;
    min-height: 0;
    height: 180px;
    max-height: none;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}
.checkout-preview-viewport.is-desktop { width: 100%; }
.checkout-preview-viewport.is-mobile {
    max-width: 390px;
    margin-inline: auto;
}
.checkout-preview-viewport.is-mobile .checkout-preview-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
        "aside"
        "main"
        "payment"
        "actions";
}
.checkout-preview {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #f1f5f9;
    padding: 0.85rem;
    max-height: calc(100vh - 8rem);
    overflow: auto;
}
.checkout-preview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.85fr);
    grid-template-areas:
        "main aside"
        "payment payment"
        "actions actions";
    gap: 0.75rem;
    align-items: start;
}
.checkout-preview-main { grid-area: main; min-width: 0; }
.checkout-preview-aside { grid-area: aside; min-width: 0; }
.checkout-preview-payment {
    grid-area: payment;
    margin-bottom: 0;
}
.checkout-preview-actions {
    grid-area: actions;
    margin-bottom: 0;
}
.checkout-preview-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}
.checkout-preview-main > .checkout-preview-section:last-child,
.checkout-preview-aside > .checkout-preview-section:last-child { margin-bottom: 0; }
.checkout-preview-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
}
.checkout-preview-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-bottom: 1px dashed var(--border-color);
}
.checkout-preview-field:last-child { border-bottom: 0; padding-bottom: 0; }
.checkout-preview-skeleton {
    display: block;
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    margin-bottom: 0.45rem;
}
.checkout-preview-field .checkout-preview-skeleton { margin-bottom: 0; }
.checkout-preview-skeleton-lg { width: 72%; }
.checkout-preview-skeleton-md { width: 58%; }
.checkout-preview-skeleton-sm { width: 42%; }
.checkout-preview-skeleton-xs { width: 28%; margin-bottom: 0; }
.checkout-preview-total-row .checkout-preview-skeleton-xs { width: 22%; }
.checkout-preview-total-row .checkout-preview-skeleton-sm { width: 30%; margin-bottom: 0; }
.checkout-preview-product,
.checkout-preview-address {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}
.checkout-preview-summary .checkout-preview-product {
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.checkout-preview-summary .checkout-preview-product:last-of-type { margin-bottom: 0.5rem; }
.checkout-preview-thumb,
.checkout-preview-map {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}
.checkout-preview-thumb-sm { width: 52px; height: 52px; font-size: 1.05rem; }
.checkout-preview-map {
    width: 78px;
    height: 78px;
    background: linear-gradient(135deg, #dbeafe, #f1f5f9);
}
.checkout-preview-product-meta,
.checkout-preview-address-meta {
    flex: 1;
    min-width: 0;
}
.checkout-preview-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}
.checkout-preview-chip {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--body-bg);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.15rem 0.45rem;
}
.checkout-preview-chip-ph {
    display: inline-block;
    width: 88px;
    height: 18px;
    padding: 0;
    background: #e2e8f0;
    border-color: transparent;
}
.checkout-preview-chip-ph-sm { width: 64px; }
.checkout-preview-totals {
    border-top: 1px solid var(--border-color);
    padding-top: 0.65rem;
    margin-top: 0.25rem;
}
.checkout-preview-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.45rem;
}
.checkout-preview-total-row-strong {
    margin-top: 0.35rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--border-color);
}
.checkout-preview-note {
    margin-top: 0.75rem;
}
.checkout-preview-note .checkout-preview-skeleton { margin-bottom: 0; width: 70%; }
.checkout-preview-pay { min-height: 2.5rem; font-weight: 600; }
.checkout-preview-hint {
    margin-top: 0.4rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}
.theme-workspace .admin-card > .card-body { padding: 0.875rem 1rem; }
.theme-accordion .accordion-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.4rem;
    overflow: hidden;
}
.theme-accordion .accordion-item:last-child { margin-bottom: 0; }
.theme-accordion .accordion-button {
    background: var(--body-bg);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8125rem;
    line-height: 1.2;
    padding: 0.5rem 0.75rem;
    box-shadow: none;
}
.theme-accordion .accordion-button::after {
    width: 0.85rem;
    height: 0.85rem;
    background-size: 0.85rem;
}
.theme-accordion .accordion-button:not(.collapsed) {
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
}
.theme-accordion .accordion-button:focus {
    box-shadow: none;
    border-color: var(--border-color);
}
.theme-accordion .accordion-body { padding: 0.75rem; }
.theme-accordion .form-label { font-size: 0.75rem; margin-bottom: 0.2rem; }
.theme-accordion .form-control,
.theme-accordion .form-select {
    min-height: calc(1.4em + 0.45rem + 2px);
    height: auto;
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}
.theme-accordion .form-control-color {
    width: 2rem;
    min-height: calc(1.4em + 0.45rem + 2px);
    height: auto;
    padding: 0.15rem;
}
.theme-accordion .form-text { font-size: 0.7rem; margin-top: 0.15rem; }
.theme-accordion h6 { font-size: 0.7rem; letter-spacing: 0.04em; margin-bottom: 0.5rem !important; }
.theme-accordion .row.g-3 { --bs-gutter-x: 0.6rem; --bs-gutter-y: 0.6rem; }
.theme-accordion .mb-4 { margin-bottom: 0.65rem !important; }
.theme-accordion .form-check-input[role="switch"] {
    width: 2.1rem;
    height: 1.1rem;
    margin-top: 0.15rem;
    cursor: pointer;
}
.theme-accordion .form-check-label { font-size: 0.8125rem; }
#themeForm > .btn {
    margin-top: 0.75rem !important;
    padding: 0.35rem 0.85rem;
    font-size: 0.8125rem;
}
.theme-accordion .btn-group .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.45rem;
    height: auto;
    min-height: var(--control-height, 2rem);
}
.theme-accordion .form-range {
    padding: 0;
    height: 1.2rem;
}
@media (max-width: 1199.98px) {
    .checkout-preview-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "aside"
            "main"
            "payment"
            "actions";
    }
}
@media (max-width: 991.98px) {
    .theme-preview-card { position: static; }
    .checkout-preview { max-height: none; }
}

.session-stat-card .session-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}
.session-stat-card .session-stat-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}
.session-dl dt {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}
.session-dl dd {
    font-size: 0.8125rem;
    margin-bottom: 0.65rem;
}
.session-trail {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid var(--border-color);
}
.session-trail li {
    position: relative;
    padding: 0 0 1rem 1rem;
}
.session-trail li:last-child { padding-bottom: 0; }
.session-trail li::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 0.35rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}
.session-trail-title { font-weight: 600; font-size: 0.8125rem; }
.session-trail-url { font-size: 0.75rem; color: var(--text-secondary); }
.session-trail-at { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; }
.session-timeline {
    list-style: none;
    margin: 0;
    padding: 0.75rem 1rem;
}
.session-timeline li {
    position: relative;
    display: flex;
    gap: 0.75rem;
    padding-bottom: 1rem;
}
.session-timeline li:last-child { padding-bottom: 0; }
.session-timeline-dot {
    width: 10px;
    height: 10px;
    margin-top: 0.35rem;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
}
.session-timeline-body { flex: 1; min-width: 0; }
.session-payload {
    margin-top: 0.5rem;
    padding: 0.65rem 0.75rem;
    background: var(--body-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.7rem;
    max-height: 240px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.analytics-funnel-card { min-height: 100%; }
.analytics-visitor-total {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
}
.analytics-goal-table {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}
.analytics-goal-table th,
.analytics-goal-table td {
    white-space: nowrap;
}
.analytics-goal-table tbody tr:last-child td {
    border-bottom: 0;
}
.analytics-converted-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.25rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
    font-weight: 600;
    font-size: 0.75rem;
}
.analytics-progress {
    height: 0.55rem;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.1);
    overflow: hidden;
}
.analytics-progress .progress-bar {
    border-radius: 999px;
}
.analytics-progress-split {
    height: 0.75rem;
    display: flex;
}
.analytics-progress-split .progress-bar {
    border-radius: 0;
}
.analytics-progress-split .progress-bar:first-child {
    border-radius: 999px 0 0 999px;
}
.analytics-progress-split .progress-bar:last-child {
    border-radius: 0 999px 999px 0;
}
.analytics-rank-row {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(80px, 1.1fr);
    gap: 0.75rem;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-color);
}
.analytics-rank-row:last-child { border-bottom: 0; padding-bottom: 0; }
.analytics-rank-row:first-child { padding-top: 0; }
.analytics-rank-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}
.analytics-flag-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 0.35rem;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.analytics-browser-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.85rem;
    background: var(--body-bg);
    height: 100%;
}
.analytics-browser-icon {
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.4rem;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}
@media (max-width: 767.98px) {
    .analytics-rank-row {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }
}
