/* UnifiedAnalytiX design system — aligned with login.html */

:root {
    --bg-primary: #0B1120;
    --bg-secondary: #111827;
    --bg-card: #151D2E;
    --bg-card-hover: #1A2438;
    --border-color: #1E293B;
    --border-light: #253349;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --accent-blue: #3B82F6;
    --accent-purple: #A855F7;
    --accent-green: #22C55E;
    --accent-red: #EF4444;
    --accent-orange: #F97316;
    --accent-cyan: #06B6D4;
    --nav-bg: #0F172A;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body.uax-body,
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ambient background orbs */
.uax-page-bg,
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.uax-page-bg .orb,
.login-bg .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}

.uax-page-bg .orb-1,
.login-bg .orb-1 {
    width: 600px;
    height: 600px;
    background: #3B82F6;
    top: -200px;
    right: -100px;
}

.uax-page-bg .orb-2,
.login-bg .orb-2 {
    width: 500px;
    height: 500px;
    background: #A855F7;
    bottom: -150px;
    left: -100px;
}

.uax-page-bg .orb-3,
.login-bg .orb-3 {
    width: 300px;
    height: 300px;
    background: #22C55E;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.uax-page-content {
    position: relative;
    z-index: 1;
}

/* Glass / card surfaces */
.uax-glass,
.glass {
    background: rgba(21, 29, 46, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-card,
.uax-card {
    background: rgba(21, 29, 46, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
}

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

/* Logo */
.logo-section {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon,
.uax-logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #3B82F6, #A855F7);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
}

.logo-section h1,
.uax-brand-title,
.logo-header h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #3B82F6, #A855F7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-section p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.uax-header-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3B82F6, #A855F7);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

/* Auth layout */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 20px;
    margin: 0 auto;
}

body.uax-auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    padding: 40px 32px;
}

.auth-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--accent-blue);
}

.form-input::placeholder {
    color: #475569;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394A3B8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
}

.input-with-icon .form-input {
    padding-left: 40px;
}

.input-with-icon .toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
    font-size: 14px;
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
}

.form-row label {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin-bottom: 0;
}

.form-row a {
    color: var(--accent-blue);
    text-decoration: none;
}

.form-row a:hover {
    text-decoration: underline;
}

.checkbox-custom {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid #fff4;
    border-top-color: #fff;
    border-radius: 50%;
    animation: uax-spin 0.6s linear infinite;
}

.btn-secondary {
    width: 100%;
    padding: 13px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.btn-secondary:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: #334155;
}

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

/* SSO */
.sso-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.sso-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sso-btn:hover {
    border-color: #334155;
    background: #182035;
}

.sso-btn i,
.sso-btn svg {
    width: 22px;
    font-size: 18px;
    text-align: center;
}

.sso-btn .sso-arrow {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 12px;
}

.divider,
.section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.divider::before,
.divider::after,
.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.footer-text {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-text a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}

.footer-text a:hover {
    text-decoration: underline;
}

.uax-footer-legal {
    text-align: center;
    margin-top: 16px;
    font-size: 11px;
    color: #475569;
}

.uax-footer-legal a {
    color: #475569;
    text-decoration: none;
}

.uax-footer-legal a:hover {
    color: var(--text-secondary);
}

/* Messages & badges */
.error-msg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: #FCA5A5;
    margin-bottom: 16px;
    display: none;
}

.error-msg i {
    margin-right: 6px;
}

.success-msg {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: #86EFAC;
    margin-bottom: 16px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.connected {
    background: rgba(34, 197, 94, 0.12);
    color: #22C55E;
}

.status-badge.pending {
    background: rgba(234, 179, 8, 0.12);
    color: #EAB308;
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.modal-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-close {
    float: right;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
}

.password-strength {
    height: 3px;
    border-radius: 2px;
    background: var(--border-color);
    margin-top: 6px;
    overflow: hidden;
}

.password-strength .bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
    width: 0%;
}

/* App shell */
.uax-app-header {
    border-bottom: 1px solid var(--border-color);
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(12px);
    position: relative;
    z-index: 10;
}

.uax-sidebar {
    background: var(--nav-bg) !important;
    border-right: 1px solid var(--border-color);
}

.uax-sidebar .uax-brand,
.uax-brand {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3B82F6, #A855F7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.uax-nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.uax-nav-link:hover {
    color: var(--text-primary);
}

.uax-nav-link.active {
    background: var(--bg-card);
    color: var(--text-primary);
    border-left: 3px solid var(--accent-blue);
}

.uax-main-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

/* Toggle */
.toggle-switch {
    width: 44px;
    height: 24px;
    background: #334155;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.25s;
    flex-shrink: 0;
}

.toggle-switch.on {
    background: var(--accent-blue);
}

.toggle-switch .knob {
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left 0.25s;
}

.toggle-switch.on .knob {
    left: 22px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.connected {
    background: #22C55E;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.status-dot.disconnected {
    background: #64748B;
}

.provider-selected,
.plan-selected {
    border-color: var(--accent-blue) !important;
    background: rgba(59, 130, 246, 0.08) !important;
}

.addon-active {
    border-color: var(--accent-green) !important;
    background: rgba(34, 197, 94, 0.08) !important;
}

/* Dashboard metric cards */
.metric-card {
    background: linear-gradient(135deg, #1E3A5F 0%, #0F172A 100%);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    transition: transform 0.2s ease-in-out;
    color: var(--text-primary);
}

.metric-card:hover {
    transform: translateY(-2px);
}

.metric-card.revenue {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(15, 23, 42, 1) 100%);
}

.metric-card.customers {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(15, 23, 42, 1) 100%);
}

.metric-card.growth {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25) 0%, rgba(15, 23, 42, 1) 100%);
}

.step-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
}

.step-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.5;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-icon i {
    font-size: 36px;
    color: var(--accent-green);
}

.config-list {
    margin: 20px 0;
}

.config-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.config-item:last-child {
    border-bottom: none;
}

.info-banner {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    font-size: 13px;
    color: #93C5FD;
    line-height: 1.5;
}

.info-banner i {
    color: var(--accent-blue);
    margin-top: 2px;
    flex-shrink: 0;
}

.hidden {
    display: none !important;
}

.loading-spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: uax-spin 2s linear infinite;
    margin: 0 auto;
}

/* Tailwind dark overrides */
.bg-gray-100,
.bg-gray-50 {
    background: var(--bg-primary) !important;
}

.bg-white {
    background: var(--bg-card) !important;
}

.bg-gray-800,
.bg-gray-700 {
    background: var(--nav-bg) !important;
}

.text-gray-900,
.text-gray-800,
.text-gray-700 {
    color: var(--text-primary) !important;
}

.text-gray-600,
.text-gray-500,
.text-gray-300 {
    color: var(--text-secondary) !important;
}

.text-gray-400,
.text-gray-100 {
    color: var(--text-muted) !important;
}

.text-indigo-600,
.text-blue-600,
.text-blue-400 {
    color: var(--accent-blue) !important;
}

.text-green-600,
.text-green-400 {
    color: var(--accent-green) !important;
}

.text-red-600,
.text-red-800,
.text-red-700 {
    color: #FCA5A5 !important;
}

.text-green-800 {
    color: #86EFAC !important;
}

.border-gray-200,
.border-gray-300,
.border-gray-100,
.border-white\/10 {
    border-color: var(--border-color) !important;
}

.border-indigo-500 {
    border-color: var(--accent-blue) !important;
}

.border-red-200 {
    border-color: rgba(239, 68, 68, 0.25) !important;
}

.shadow,
.shadow-sm,
.shadow-lg,
.shadow-xl {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.bg-indigo-600,
.bg-blue-600,
.hover\:bg-indigo-700:hover,
.hover\:bg-blue-700:hover {
    background: linear-gradient(135deg, #3B82F6, #2563EB) !important;
}

.bg-green-600 {
    background: var(--accent-green) !important;
}

.bg-gray-600 {
    background: var(--bg-card-hover) !important;
}

.bg-green-100 {
    background: rgba(34, 197, 94, 0.12) !important;
}

.bg-red-50 {
    background: rgba(239, 68, 68, 0.08) !important;
}

.bg-gray-200,
.bg-gray-300 {
    background: var(--border-color) !important;
}

.bg-indigo-100,
.bg-indigo-50,
.from-indigo-50,
.to-blue-50 {
    background: rgba(59, 130, 246, 0.08) !important;
}

.bg-yellow-50 {
    background: rgba(234, 179, 8, 0.08) !important;
}

.border-yellow-200 {
    border-color: rgba(234, 179, 8, 0.25) !important;
}

.rounded-lg,
.rounded-xl,
.rounded-2xl {
    border-radius: 16px;
}

input,
select,
textarea {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
}

.hover\:bg-gray-50:hover,
.hover\:bg-gray-100:hover,
.hover\:bg-gray-300:hover {
    background: var(--bg-card-hover) !important;
}

.form-select,
.form-control {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.btn-outline-secondary {
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

.btn-outline-secondary:hover {
    background: var(--bg-card-hover) !important;
    color: var(--text-primary) !important;
}

.connection-card {
    transition: all 0.3s ease;
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

.connection-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: var(--bg-card-hover) !important;
}

.connection-card.connected {
    border-color: var(--accent-green) !important;
    background: rgba(34, 197, 94, 0.06) !important;
}

.connection-card.error {
    border-color: var(--accent-red) !important;
    background: rgba(239, 68, 68, 0.06) !important;
}

.status-connected {
    background: rgba(34, 197, 94, 0.15);
    color: #4ADE80;
}

.status-error {
    background: rgba(239, 68, 68, 0.15);
    color: #FCA5A5;
}

.status-disconnected {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-secondary);
}

.connection-type-tab,
.profile-tab {
    border-radius: 22px !important;
    border-bottom: none !important;
    border: 1px solid transparent !important;
    transition: all 0.25s ease;
}

.connection-type-tab.border-indigo-500,
.connection-type-tab[class*='border-indigo-500'],
.profile-tab.border-indigo-500,
.profile-tab[class*='border-indigo-500'] {
    background: var(--accent-blue) !important;
    color: #fff !important;
    border-color: transparent !important;
}

.profile-tab:not([class*='border-indigo-500']) {
    color: var(--text-secondary) !important;
}

.profile-tab:not([class*='border-indigo-500']):hover {
    background: var(--bg-card-hover) !important;
    color: var(--text-primary) !important;
}

.advanced-search-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.search-toggle-header {
    background: var(--bg-secondary);
    padding: 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.search-toggle-header:hover {
    background: var(--bg-card-hover);
}

.advanced-search-section.collapsed .search-content {
    display: none;
}

.advanced-search-section.collapsed .search-toggle-header i {
    transform: rotate(-90deg);
}

.condition-row {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.marketplace-card {
    transition: all 0.3s ease;
}

.marketplace-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.uax-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
}

.business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.business-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.business-chip:hover {
    border-color: var(--accent-blue);
    background: var(--bg-card-hover);
}

.business-chip.selected {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.12);
}

.workspace-step-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.workspace-preview-panel,
.workspace-confirm-panel {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-secondary);
}

.workspace-preview-summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.workspace-preview-mode {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
}

.workspace-preview-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.workspace-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.workspace-preview-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
}

.workspace-preview-card-wide {
    grid-column: 1 / -1;
}

.workspace-preview-card h5 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.workspace-preview-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    color: var(--text-primary);
}

.workspace-preview-list li + li {
    margin-top: 8px;
}

.workspace-preview-pages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.workspace-preview-page {
    display: grid;
    grid-template-columns: 18px 1fr auto;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    color: var(--text-primary);
}

.workspace-preview-path {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.08);
    padding: 2px 6px;
    border-radius: 6px;
}

.workspace-preview-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.workspace-preview-kpi {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    font-size: 12px;
    font-weight: 600;
}

.workspace-config-flow .form-input {
    max-width: 320px;
}

.billing-panel .billing-stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
}

.billing-panel .billing-stat-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.billing-panel .billing-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.billing-seat-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
}

.billing-seat-btn:hover {
    border-color: var(--accent-blue);
}

.billing-seat-input {
    width: 96px !important;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
}

.billing-preset-btn {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
}

.billing-preset-btn:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.billing-status-pill {
    display: inline-flex;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.billing-status-active {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

.billing-status-trialing,
.billing-status-past_due {
    background: rgba(234, 179, 8, 0.15);
    color: #fde047;
}

.uax-modal-backdrop {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.cohort-cell {
    transition: all 0.3s ease;
}

.cohort-cell:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .desktop-sidebar {
        display: none !important;
    }

    .main-content-area {
        margin-left: 0 !important;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px;
        border-radius: 20px;
    }

    .logo-icon,
    .uax-logo-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* ── Customizable dashboard insights ── */
.uax-customize-btn.active {
    background: var(--accent-green) !important;
}

.uax-metrics-grid.customize-mode .uax-metric-widget {
    outline: 2px dashed rgba(59, 130, 246, 0.45);
    outline-offset: 2px;
    position: relative;
}

.uax-metric-widget.dragging {
    opacity: 0.45;
}

.uax-metric-widget.drag-over {
    outline-color: var(--accent-green);
    transform: scale(1.02);
}

.uax-metric-widget {
    position: relative;
}

.uax-drag-handle {
    position: absolute;
    top: 10px;
    left: 10px;
    color: rgba(255, 255, 255, 0.5);
    cursor: grab;
    font-size: 14px;
}

.uax-widget-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    cursor: pointer;
    font-size: 11px;
    z-index: 2;
}

.uax-widget-remove:hover {
    background: rgba(239, 68, 68, 0.85);
}

#uaxInsightsPanel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    z-index: 200;
    pointer-events: none;
}

.uax-insights-panel {
    width: 320px;
    max-width: 90vw;
    height: 100%;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-light);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    padding: 20px;
    pointer-events: auto;
}

.uax-insights-panel.open {
    transform: translateX(0);
}

.uax-insights-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.uax-insights-panel-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.uax-panel-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
}

.uax-insights-hint {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.uax-audience-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.uax-audience-filter button {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
}

.uax-audience-filter button.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.uax-palette-section h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin: 12px 0 8px;
}

.uax-palette-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    cursor: grab;
    font-size: 13px;
    color: var(--text-primary);
}

.uax-palette-item:active {
    cursor: grabbing;
}

.uax-palette-item i:first-child {
    width: 18px;
    color: var(--accent-blue);
}

.uax-palette-item span {
    flex: 1;
}

.uax-palette-add {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-blue);
    cursor: pointer;
    font-size: 11px;
}

.uax-palette-add:hover {
    background: var(--accent-blue);
    color: #fff;
}

.uax-palette-actions {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.uax-btn-ghost {
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    width: 100%;
}

.uax-btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}
