/* 
 * WAIVAA Client Portal - Premium UI System
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #0a64f1;
    --primary-light: #e3f2fd;
    --primary-dark: #0551d3;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-app: #f1f5f9;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Reset & Base */
.waivaa-dashboard-wrapper * {
    box-sizing: border-box;
}

.waivaa-dashboard-wrapper {
    font-family: 'Inter', sans-serif;
    background: var(--bg-app);
    color: var(--text-main);
    min-height: 100vh;
}

/* Layout */
.waivaa-dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.waivaa-sidebar {
    width: 260px;
    background: #0f172a;
    color: white;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-brand {
    padding: 30px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    background: var(--primary);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.brand-logo svg {
    width: 100%;
    height: 100%;
}

.brand-text {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
}

.brand-text span {
    color: var(--primary);
}

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

.waivaa-nav-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.waivaa-nav-item {
    margin-bottom: 4px !important;
    list-style: none !important;
}

.waivaa-nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none !important;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.waivaa-nav-item a:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.waivaa-nav-item.is-active a {
    background: var(--primary);
    color: white;
}

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

.sidebar-footer {
    margin-top: auto;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #fca5a5;
    text-decoration: none !important;
    font-weight: 600;
}

/* Main Content */
.waivaa-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.waivaa-topbar {
    background: white;
    height: 70px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.waivaa-topbar h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.waivaa-content-area {
    padding: 32px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg { width: 28px; height: 28px; }

.icon-blue { background: #eff6ff; color: #2563eb; }
.icon-green { background: #ecfdf5; color: #10b981; }
.icon-purple { background: #f5f3ff; color: #8b5cf6; }

.stat-label {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 800;
    margin-top: 4px;
}

.status-active { color: var(--success); }

/* Content Cards */
.grid-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.card-body { padding: 24px; }

/* Dashboard Overview Specifics */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-item {
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.chat-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.chat-phone { font-weight: 700; font-size: 13px; }
.chat-time { font-size: 12px; color: var(--text-muted); }

.chat-preview p { margin: 4px 0; font-size: 13px; }
.msg-in span { color: var(--primary); font-weight: 600; }
.msg-out span { color: var(--success); font-weight: 600; }

.quick-info .info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* Forms & Inputs */
.premium-form .form-group { margin-bottom: 24px; }
.premium-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; }

.premium-form input[type="text"],
.premium-form input[type="password"],
.premium-form input[type="email"],
.premium-form textarea,
.premium-form select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.premium-form input:focus, .premium-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    outline: none;
}

/* Tone Selector */
.tone-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.tone-option input { display: none; }
.tone-card {
    border: 1.5px solid var(--border);
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.tone-option input:checked + .tone-card {
    border-color: var(--primary);
    background: var(--primary-light);
}

.tone-title { display: block; font-weight: 700; font-size: 14px; }
.tone-desc { display: block; font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* FAQ List */
.premium-faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.premium-faq-item {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.faq-q { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.faq-a { font-size: 13px; color: var(--text-muted); }

.faq-actions { display: flex; gap: 8px; }
.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #f1f5f9;
    border: none;
    color: var(--text-muted);
}

.edit-faq:hover { background: var(--primary-light); color: var(--primary); }
.delete-faq:hover { background: #fee2e2; color: var(--danger); }

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}

.btn-outline:hover { background: #f8fafc; border-color: var(--text-muted); }

.full-width { width: 100%; }

/* Subscription Card */
.subscription-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 40px;
    border-radius: 24px;
}

.sub-header { display: flex; justify-content: space-between; margin-bottom: 30px; }
.sub-plan-name { font-size: 32px; font-weight: 800; margin: 5px 0; }
.sub-details { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.detail-label { display: block; color: #94a3b8; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.detail-value { font-size: 18px; font-weight: 700; }

/* Sections Display */
.waivaa-section { display: none; animation: fadeIn 0.3s ease; }
.waivaa-section.is-active { display: block; }

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

/* Responsive */
@media (max-width: 1024px) {
    .waivaa-sidebar { width: 80px; }
    .brand-text, .nav-label { display: none; }
    .sidebar-brand { justify-content: center; }
    .waivaa-nav-item a { justify-content: center; }
}

@media (max-width: 768px) {
    .waivaa-dashboard-layout { flex-direction: column; }
    .waivaa-sidebar { width: 100%; height: auto; position: relative; }
    .waivaa-nav-list { display: flex; overflow-x: auto; padding: 10px !important; }
    .content-grid { grid-template-columns: 1fr; }
}

/* Form Pending Styles */
.wcpp-form-container {
    max-width: 450px;
    margin: 60px auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.wcpp-form-container h2 { margin-bottom: 10px; font-weight: 800; }
.wcpp-form-container .subtitle { color: var(--text-muted); margin-bottom: 30px; }

/* Premium Auth Styles */
.wcpp-auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    background: var(--bg-app);
    min-height: calc(100vh - 100px);
}

.wcpp-auth-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 500px;
    padding: 48px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    animation: fadeIn 0.4s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 24px;
    margin: 0 auto 20px;
}

.auth-header h2 {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

.auth-header .subtitle {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
}

.auth-header .pending-highlight {
    color: var(--warning);
    font-weight: 700;
}

/* Auth Form Elements */
.premium-auth-form .form-group {
    margin-bottom: 24px;
}

.premium-auth-form label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-main);
}

.premium-auth-form input {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: #fff;
    box-sizing: border-box;
}

.premium-auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.auth-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

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

/* Icons & Info */
.auth-icon-pending, .auth-icon-success {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.auth-icon-pending { background: #fff7ed; color: #f97316; }
.auth-icon-success { background: #f0fdf4; color: #22c55e; }

.auth-icon-pending svg, .auth-icon-success svg { width: 32px; height: 32px; }

.auth-pending-info {
    background: #f8fafc;
    padding: 24px;
    border-radius: 16px;
    border: 1px dashed var(--border);
    margin-bottom: 30px;
    text-align: center;
}

.auth-pending-info p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.6;
}

.auth-pending-info p:last-child { margin-bottom: 0; }

.auth-error-msg {
    background: #fef2f2;
    color: #dc2626;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    margin-bottom: 24px;
    border: 1px solid #fecaca;
    font-weight: 600;
}

/* Grid Layout for Registration */
.wcpp-auth-card .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .wcpp-auth-card .form-grid {
        grid-template-columns: 1fr;
    }
    .wcpp-auth-card {
        padding: 32px 24px;
    }
}

/* Health Banner */
.health-banner {
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow);
}

.health-good { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.health-warning { background: #fffbeb; border: 1px solid #fef3c7; color: #92400e; }

.health-content { display: flex; align-items: center; gap: 16px; }
.health-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.5); }
.health-icon svg { width: 24px; height: 24px; }
.health-text h3 { margin: 0; font-size: 18px; }
.health-text p { margin: 4px 0 0 0; font-size: 14px; opacity: 0.8; }

.health-progress { height: 8px; background: rgba(0,0,0,0.05); border-radius: 4px; overflow: hidden; }
.health-progress .progress-bar { height: 100%; background: currentColor; transition: width 1s ease-in-out; }

/* Onboarding Steps */
.onboarding-steps { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.step-item { display: flex; align-items: center; gap: 12px; color: var(--text-muted); }
.step-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.step-done { color: var(--success); }
.step-done .step-check { background: var(--success); color: white; border-color: var(--success); }
.step-label { font-size: 14px; font-weight: 600; }

.form-divider { height: 1px; background: var(--border); margin: 32px 0; }
.prompt-tips { margin-top: 12px; font-size: 12px; color: var(--text-muted); background: #f8fafc; padding: 12px; border-radius: 8px; border-left: 4px solid var(--primary); }

/* Subscription & Billing Enhancements */
.billing-card {
    overflow: hidden;
}

.billing-hero {
    align-items: flex-start;
    gap: 24px;
}

.sub-description {
    margin: 10px 0 0;
    color: #cbd5e1;
    max-width: 680px;
    line-height: 1.6;
}

.billing-status-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.badge-warning {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.badge-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.trial-countdown-panel {
    margin: 24px 0;
    padding: 24px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.trial-countdown-copy h3 {
    margin: 6px 0;
    color: #ffffff;
    font-size: 28px;
    line-height: 1.2;
}

.trial-countdown-copy p {
    margin: 0 0 18px;
    color: #cbd5e1;
}

.trial-meter {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    overflow: hidden;
}

.trial-meter-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #38bdf8);
    transition: width 0.3s ease;
}

.billing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.billing-info-card {
    padding: 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.billing-info-card .detail-label,
.billing-info-card .detail-value {
    display: block;
}

.billing-info-card .detail-value {
    margin-top: 8px;
    color: #ffffff;
}

.strong-value {
    font-weight: 800;
}

.billing-note {
    margin-top: 20px;
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
}

.billing-note strong {
    display: block;
    color: #ffffff;
    margin-bottom: 6px;
}

.billing-note p {
    margin: 0;
}

@media (max-width: 1024px) {
    .billing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .billing-hero {
        flex-direction: column;
    }

    .billing-status-stack {
        align-items: flex-start;
    }

    .billing-grid,
    .sub-details {
        grid-template-columns: 1fr;
    }

    .trial-countdown-panel {
        padding: 20px;
    }
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
}

.badge-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 45px !important;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

.toggle-password:hover {
    color: var(--primary);
}

/* Checkbox Styling */
.checkbox-group {
    margin-top: 10px;
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px;
    cursor: pointer;
    font-weight: 500 !important;
    font-size: 14px !important;
    color: var(--text-muted) !important;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

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

/* Multi-step Registration Styling */
.registration-progress-wrapper {
    margin-bottom: 40px;
    position: relative;
    padding: 0 10px;
}

.progress-bar-container {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    position: absolute;
    top: 15px;
    left: 40px;
    right: 40px;
    z-index: 1;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 2px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.step-indicator {
    width: 34px;
    height: 34px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.step-indicator.active {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.step-indicator.completed {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.form-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.form-step.active {
    display: block;
}

.step-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.step-actions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.step-actions.dual-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.step-actions .btn-primary, .step-actions .btn-outline {
    flex: 1;
    padding: 14px 24px;
}

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

/* Account Settings Enhanced UI */
.settings-container {
    display: flex;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    min-height: 500px;
}

.settings-sidebar {
    width: 240px;
    background: #f8fafc;
    border-right: 1px solid var(--border);
    padding: 24px 0;
}

.settings-nav {
    display: flex;
    flex-direction: column;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-muted);
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.settings-nav-item:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--primary);
}

.settings-nav-item.active {
    background: white;
    color: var(--primary);
    border-left-color: var(--primary);
}

.settings-nav-item.danger:hover {
    background: #fef2f2;
    color: var(--danger);
    border-left-color: var(--danger);
}

.settings-content {
    flex: 1;
    padding: 32px;
}

.settings-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.settings-tab-content.active {
    display: block;
}

.settings-header {
    margin-bottom: 32px;
}

.settings-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.settings-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.form-grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon svg:not(.eye-open):not(.eye-closed) {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-with-icon input {
    padding-left: 44px !important;
}

.input-with-icon.disabled input {
    background: #f1f5f9;
    cursor: not-allowed;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--primary);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.danger-box {
    background: #fff1f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 32px;
}

.danger-icon {
    color: #dc2626;
    background: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

.danger-text h4 {
    margin: 0 0 4px 0;
    color: #991b1b;
    font-weight: 700;
}

.danger-text p {
    margin: 0;
    color: #b91c1c;
    font-size: 14px;
    line-height: 1.5;
}

.btn-danger-large {
    background: #dc2626;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    font-size: 15px;
}

.btn-danger-large:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

@media (max-width: 768px) {
    .settings-container {
        flex-direction: column;
    }
    .settings-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 12px 0;
    }
    .settings-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 16px;
    }
    .settings-nav-item {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 12px 16px;
        white-space: nowrap;
    }
    .settings-nav-item.active {
        border-bottom-color: var(--primary);
    }
    .form-grid-two {
        grid-template-columns: 1fr;
    }
}

/* Market Insights & Enhanced Analytics */
.sentiment-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 8px;
}
.sentiment-positive { background: #ecfdf5; color: #059669; }
.sentiment-neutral { background: #f1f5f9; color: #64748b; }
.sentiment-negative { background: #fef2f2; color: #dc2626; }

.intent-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    background: #eff6ff;
    color: #2563eb;
    text-transform: uppercase;
    margin-left: 4px;
}

.sentiment-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sentiment-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sentiment-row .label {
    width: 60px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.bar-container {
    flex: 1;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.bar {
    height: 100%;
    border-radius: 4px;
}

.bar-positive { background: var(--success); }
.bar-neutral { background: var(--text-muted); }
.bar-negative { background: var(--danger); }

.sentiment-row .pct {
    width: 35px;
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

.intent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.intent-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 13px;
}

.intent-label { font-weight: 600; color: var(--text-main); }
.intent-count { font-weight: 700; color: var(--primary); }

.insight-section h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--text-main);
}

.chat-user {
    display: flex;
    align-items: center;
}

.badge-success { background: #ecfdf5; color: #059669; font-size: 11px; padding: 4px 10px; border-radius: 20px; font-weight: 700; }


/* Team Management: right-side workspace drawer */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-main);
    border-radius: 10px;
    padding: 9px 13px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.topbar-action:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgb(15 23 42 / 0.08);
    transform: translateY(-1px);
}

.topbar-action-icon {
    font-size: 16px;
}

.team-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgb(15 23 42 / 0.42);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    backdrop-filter: blur(2px);
}

.team-management-drawer {
    position: fixed !important;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    width: min(760px, 94vw);
    max-width: 100%;
    margin: 0 !important;
    padding: 28px;
    overflow-y: auto;
    background: #f8fafc;
    box-shadow: -18px 0 45px rgb(15 23 42 / 0.18);
    transform: translateX(105%);
    visibility: hidden;
    transition: transform .28s ease, visibility .28s ease;
}

.team-management-drawer.is-drawer-open {
    transform: translateX(0);
    visibility: visible;
}

.team-drawer-backdrop.is-drawer-open {
    opacity: 1;
    visibility: visible;
}

.team-drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.team-drawer-eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.team-drawer-header h2 {
    margin: 0;
    font-size: 26px;
    letter-spacing: -.03em;
}

.team-drawer-header p {
    margin: 7px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.team-drawer-close {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text-muted);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.team-drawer-close:hover {
    color: var(--text-main);
    border-color: var(--primary);
}

.team-management-drawer .grid-card {
    margin-bottom: 0;
}

.team-management-drawer .card-header {
    display: none;
}

.team-management-drawer > .grid-card > .card-body {
    padding: 0;
}

.team-management-drawer .card-body > div[style*="grid-template-columns"] {
    display: grid !important;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr) !important;
    gap: 18px !important;
}

.team-management-drawer .card-body > div[style*="grid-template-columns"] > div {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.team-management-drawer h4 {
    margin-top: 0;
    font-size: 16px;
}

.team-management-drawer .form-group {
    margin-bottom: 16px;
}

.team-management-drawer input[type="text"],
.team-management-drawer input[type="email"] {
    min-height: 44px;
}

.team-management-drawer label[style*="display:block"] {
    display: flex !important;
    align-items: flex-start;
    gap: 9px;
    margin: 9px 0 !important;
    padding: 10px 11px;
    border: 1px solid #edf2f7;
    border-radius: 9px;
    background: #f8fafc;
    font-size: 13px;
}

.team-management-drawer label[style*="display:block"]:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.team-management-drawer input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--primary);
}

.team-management-drawer .btn-primary,
.team-management-drawer .btn-outline {
    min-height: 42px;
    border-radius: 9px;
}

@media (max-width: 760px) {
    .topbar-action {
        padding: 9px 10px;
    }

    .topbar-action span:last-child {
        display: none;
    }

    .team-management-drawer {
        width: 100%;
        padding: 20px;
    }

    .team-management-drawer .card-body > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .team-management-drawer,
    .team-drawer-backdrop {
        transition: none;
    }
}

.team-management-drawer { display: block !important; }
