/**
 * style.css - Premium Stylesheet for Text-World Smart Proposal Generator
 * Incorporates website Green & White branding, glassmorphism UI, and high-fidelity print grids.
 */

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

:root {
    /* Brand Theme Colors (Main website colors - Green & White) */
    --primary-color: #22c55e;        /* Website Green */
    --primary-dark: #15803d;         /* Forest Green */
    --secondary-color: #10b981;      /* Emerald Green */
    --secondary-dark: #047857;
    --accent-orange: #ff7a00;        /* Orange Highlights */
    
    /* Slate Grays & Whites */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    
    /* General UI Variables */
    --font-family: 'Plus Jakarta Sans', sans-serif;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Box Shadows */
    --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 10px -1px rgba(15, 23, 42, 0.03);
    --shadow-medium: 0 10px 30px -5px rgba(15, 23, 42, 0.08), 0 6px 15px -3px rgba(15, 23, 42, 0.04);
    --shadow-hard: 0 20px 40px -10px rgba(15, 23, 42, 0.12), 0 10px 20px -5px rgba(15, 23, 42, 0.06);
    
    /* Glassmorphism Defaults */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.5);
}

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

body {
    font-family: var(--font-family);
    background-color: #f8fafc; /* Clean background */
    background-image: 
        radial-gradient(at 0% 0%, rgba(34, 197, 94, 0.04) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.04) 0px, transparent 50%);
    color: var(--slate-800);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--slate-50);
}
::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

/* --- LOGIN SCREEN --- */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #f1f5f9;
    background-image: 
        radial-gradient(at 0% 0%, rgba(34, 197, 94, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: var(--transition-smooth);
}

.login-card {
    background: white;
    border: 1px solid var(--slate-200);
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-hard);
    color: var(--slate-800);
    text-align: center;
}

.login-card h2 {
    color: var(--slate-900);
    font-weight: 800;
    font-size: 20px;
    margin-bottom: 8px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.login-logo i {
    font-size: 32px;
    color: var(--primary-color);
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, var(--slate-200) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card p {
    color: var(--slate-500);
    margin-bottom: 30px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--slate-300);
}

.login-card .form-group label {
    color: var(--slate-700);
}

.input-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: white;
    font-family: var(--font-family);
    font-size: 14px;
    transition: var(--transition-smooth);
}

.login-card .input-control {
    background: var(--slate-50);
    border: 1px solid var(--slate-300);
    color: var(--slate-900);
}

.input-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    outline: none;
}

.login-card .input-control:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 700;
    font-size: 15px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-top: 10px;
}

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

.preset-login-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.preset-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--slate-400);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.btn-preset {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: var(--slate-200);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: left;
    display: flex;
    flex-direction: column;
}

.btn-preset span:first-child {
    font-weight: 600;
    color: white;
}

.btn-preset span:last-child {
    font-size: 10px;
    color: var(--slate-400);
}

.btn-preset:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: var(--primary-color);
}


/* --- MAIN LAYOUT SHELL --- */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: var(--slate-900);
    color: white;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
    transition: var(--transition-smooth);
}

.sidebar-logo {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo i {
    font-size: 24px;
    color: var(--primary-color);
}

.sidebar-logo h2 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    flex-grow: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--slate-400);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.menu-item i {
    font-size: 16px;
}

.menu-item:hover, .menu-item.active {
    color: white;
    background: rgba(34, 197, 94, 0.1);
}

.menu-item.active {
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(34, 197, 94, 0.12);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}

/* User Profile Badge */
.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-circle {
    width: 38px;
    height: 38px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

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

.profile-name {
    font-weight: 600;
    font-size: 13px;
    color: white;
}

.profile-role {
    font-size: 11px;
    color: var(--slate-400);
}

.btn-logout {
    margin-top: 12px;
    width: 100%;
    padding: 8px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    color: white;
}

/* Main Viewport */
.main-viewport {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.top-bar {
    height: 70px;
    background: white;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    flex-shrink: 0;
}

.page-title h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--slate-900);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-create-proposal-header {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

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

/* Content Area */
.content-area {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
}

.view-section {
    display: none; /* Controlled by routing */
    animation: sectionFadeIn 0.4s ease-out;
}

.view-section.active {
    display: block;
}

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


/* --- DASHBOARD SECTION --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--slate-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.stat-content h3 {
    font-size: 12px;
    color: var(--slate-500);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.stat-content p {
    font-size: 28px;
    font-weight: 800;
    color: var(--slate-900);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-card.green .stat-icon { background: rgba(34, 197, 94, 0.1); color: var(--primary-color); }
.stat-card.blue .stat-icon { background: rgba(16, 185, 129, 0.1); color: var(--secondary-color); }
.stat-card.orange .stat-icon { background: rgba(255, 122, 0, 0.1); color: var(--accent-orange); }
.stat-card.purple .stat-icon { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.dashboard-panel {
    background: white;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--slate-100);
    padding: 24px;
    margin-bottom: 30px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--slate-100);
    padding-bottom: 15px;
}

.panel-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--slate-900);
}

/* Basic SVG Chart Styles */
.chart-container {
    width: 100%;
    height: 240px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding-top: 20px;
}

.chart-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.chart-bar {
    width: 28px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 4px 4px 0 0;
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.chart-bar:hover {
    background: var(--secondary-color);
}

.chart-bar-label {
    font-size: 11px;
    color: var(--slate-500);
    margin-top: 8px;
    font-weight: 500;
}

.chart-value-tooltip {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--slate-800);
    color: white;
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: bold;
    display: none;
}

.chart-bar:hover .chart-value-tooltip {
    display: block;
}


/* --- CREATE PROPOSAL WIZARD --- */
.wizard-header {
    margin-bottom: 30px;
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 0 auto 20px;
    max-width: 800px;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--slate-200);
    z-index: 1;
}

.step-progress-line {
    position: absolute;
    top: 20px;
    left: 0;
    height: 3px;
    background: var(--primary-color);
    z-index: 2;
    width: 0%;
    transition: width 0.3s ease;
}

.step-indicator {
    width: 40px;
    height: 40px;
    background: white;
    border: 3px solid var(--slate-300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--slate-500);
    z-index: 3;
    transition: var(--transition-smooth);
    position: relative;
}

.step-indicator.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}

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

.step-label {
    position: absolute;
    top: 48px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--slate-500);
}

.step-indicator.active .step-label {
    color: var(--slate-900);
}

.wizard-card {
    background: white;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-medium);
    padding: 35px;
    margin-bottom: 25px;
    border: 1px solid var(--slate-200);
}

.wizard-step-panel {
    display: none;
}

.wizard-step-panel.active {
    display: block;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-grid-full {
    grid-column: span 2;
}

.form-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--slate-900);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-title i {
    color: var(--primary-color);
}

/* Control elements */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--slate-300);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--slate-800);
    background: var(--slate-50);
    transition: var(--transition-smooth);
}

.form-input:focus {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
    outline: none;
}

.form-input.error {
    border-color: #ef4444;
    background: #fef2f2;
}

/* Selector Grids */
.plans-selector-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.plan-option-card {
    border: 2px solid var(--slate-200);
    border-radius: var(--border-radius-md);
    padding: 24px;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    display: flex;
    flex-direction: column;
}

.plan-option-card:hover {
    border-color: var(--slate-300);
    transform: translateY(-3px);
}

.plan-option-card.selected {
    border-color: var(--primary-color);
    background: rgba(34, 197, 94, 0.02);
}

.plan-option-card.selected::after {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 15px;
    right: 15px;
    color: var(--primary-color);
    font-size: 18px;
}

.plan-card-tag {
    background: var(--slate-100);
    color: var(--slate-700);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
    align-self: flex-start;
    margin-bottom: 12px;
}

.plan-option-card.selected .plan-card-tag {
    background: rgba(34, 197, 94, 0.12);
    color: var(--primary-dark);
}

.plan-card-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 8px;
}

.plan-card-price {
    font-size: 26px;
    font-weight: 800;
    color: var(--slate-900);
    margin-bottom: 5px;
}

.plan-card-price span {
    font-size: 12px;
    color: var(--slate-500);
    font-weight: 400;
}

.plan-card-desc {
    font-size: 12px;
    color: var(--slate-500);
    margin-bottom: 15px;
}

.plan-card-features {
    font-size: 12px;
    color: var(--slate-600);
    list-style: none;
    margin-top: auto;
}

.plan-card-features li {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-card-features li i {
    color: var(--primary-color);
}

/* Addons Checkbox List */
.addons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.addon-checkbox-label {
    border: 1px solid var(--slate-200);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.addon-checkbox-label:hover {
    border-color: var(--slate-300);
    background: var(--slate-50);
}

.addon-info-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.addon-info-block input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.addon-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--slate-800);
}

.addon-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--slate-900);
}

.addon-checkbox-label.selected {
    border-color: var(--primary-color);
    background: rgba(34, 197, 94, 0.02);
}

/* Pricing Summary Panel */
.proposal-summary-sidebar {
    background: var(--slate-900);
    color: white;
    border-radius: var(--border-radius-md);
    padding: 24px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-title {
    font-size: 15px;
    font-weight: 700;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 16px;
    color: white;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--slate-400);
    margin-bottom: 10px;
}

.summary-row.total {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
    margin-top: 15px;
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.summary-row.total span:last-child {
    color: var(--primary-color);
}

/* Wizard Buttons */
.wizard-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.btn-wizard {
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
}

.btn-wizard-back {
    background: var(--slate-200);
    color: var(--slate-700);
}

.btn-wizard-back:hover {
    background: var(--slate-300);
}

.btn-wizard-next {
    background: var(--primary-color);
    color: white;
}

.btn-wizard-next:hover {
    background: var(--primary-dark);
}


/* --- PROPOSALS HISTORY LIST --- */
.filter-card {
    background: white;
    padding: 20px 24px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--slate-150);
    margin-bottom: 25px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: flex-end;
}

.table-card {
    background: white;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--slate-150);
    overflow: hidden;
}

.app-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.app-table th {
    background: var(--slate-50);
    padding: 16px 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--slate-500);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--slate-200);
}

.app-table td {
    padding: 16px 20px;
    font-size: 13px;
    color: var(--slate-700);
    border-bottom: 1px solid var(--slate-100);
}

.app-table tbody tr:hover td {
    background: var(--slate-50);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.active { background: rgba(34, 197, 94, 0.12); color: var(--primary-dark); }
.status-badge.inactive { background: rgba(239, 68, 68, 0.12); color: #dc2626; }

.plan-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: white;
}
.plan-badge.connect { background: #10b981; }
.plan-badge.engage { background: #059669; }
.plan-badge.scale { background: #047857; }
.plan-badge.infinity { background: #065f46; }

.table-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--slate-200);
    background: white;
    color: var(--slate-600);
    font-size: 12px;
    transition: var(--transition-smooth);
}

.btn-icon:hover {
    background: var(--slate-100);
    color: var(--slate-900);
}

.btn-icon.download {
    color: var(--primary-color);
    border-color: rgba(34, 197, 94, 0.2);
}
.btn-icon.download:hover {
    background: rgba(34, 197, 94, 0.05);
}

.btn-icon.delete {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}
.btn-icon.delete:hover {
    background: rgba(239, 68, 68, 0.05);
}


/* --- ADMIN SETTINGS PAGE --- */
.settings-tab-container {
    display: flex;
    gap: 30px;
}

.settings-nav {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-tab-btn {
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--slate-600);
    text-align: left;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.settings-tab-btn:hover {
    background: var(--slate-100);
}

.settings-tab-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-soft);
}

.settings-content {
    flex-grow: 1;
    background: white;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--slate-200);
    padding: 30px;
}

.settings-section-panel {
    display: none;
}

.settings-section-panel.active {
    display: block;
}


/* --- PDF LIVE PREVIEW MODAL --- */
.preview-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
    transition: var(--transition-smooth);
    opacity: 0;
    pointer-events: none;
}

.preview-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.preview-modal-window {
    width: 90%;
    max-width: 1050px;
    height: 100%;
    background: var(--slate-900);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-hard);
}

.preview-modal-backdrop.active .preview-modal-window {
    transform: translateX(0);
}

.preview-modal-header {
    height: 70px;
    background: var(--slate-800);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    color: white;
}

.preview-modal-header h2 {
    font-size: 16px;
    font-weight: 700;
}

.preview-header-actions {
    display: flex;
    gap: 12px;
}

.btn-preview-action {
    padding: 10px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-preview-action.close {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}
.btn-preview-action.close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-preview-action.download {
    background: var(--primary-color);
    color: white;
}
.btn-preview-action.download:hover {
    background: var(--primary-dark);
}

.btn-preview-action.print {
    background: var(--secondary-color);
    color: white;
}
.btn-preview-action.print:hover {
    background: var(--secondary-dark);
}

.preview-modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    justify-content: center;
    background: #475569;
}


/* --- THE HIGH FIDELITY PROPOSAL TEMPLATE DESIGN (A4 size target) --- */
.proposal-pdf-container {
    width: 790px;
    background: white;
    color: var(--slate-800);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.5;
}

/* Standard PDF Page styling */
.pdf-page {
    width: 100%;
    min-height: 1080px;
    padding: 45px 50px;
    position: relative;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
    margin-bottom: 25px;
}

.pdf-page:last-child {
    margin-bottom: 0;
}

/* Page Header & Footer */
.pdf-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--slate-200);
    padding-bottom: 12px;
    margin-bottom: 30px;
}

.pdf-header-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 800;
    color: var(--slate-900);
}

.pdf-header-logo i {
    color: var(--primary-color);
}

.pdf-header-tag {
    font-size: 11px;
    color: var(--slate-400);
    font-weight: 600;
    text-transform: uppercase;
}

.pdf-page-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--slate-200);
    padding-top: 12px;
    margin-top: 30px;
    font-size: 10px;
    color: var(--slate-400);
}

.pdf-footer-branding {
    font-weight: 600;
}

.pdf-footer-page-num {
    font-weight: 700;
}

/* Cover Page */
.pdf-cover-page {
    justify-content: space-between;
    padding: 80px 60px;
    background: linear-gradient(135deg, var(--slate-900) 0%, var(--slate-800) 100%);
    color: white;
}

.pdf-cover-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.pdf-cover-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 800;
}

.pdf-cover-brand i {
    color: var(--primary-color);
    font-size: 32px;
}

.pdf-cover-accent-bar {
    width: 80px;
    height: 6px;
    background: var(--primary-color); /* Updated to Green */
    border-radius: 3px;
    margin-top: 50px;
}

.pdf-cover-middle h1 {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 12px;
    letter-spacing: -1px;
    color: white;
}

.pdf-cover-middle .subtitle {
    font-size: 16px;
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
}

.pdf-cover-details {
    display: flex;
    gap: 40px;
    margin-top: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
}

.pdf-cover-detail-col h4 {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--slate-400);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.pdf-cover-detail-col p {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.pdf-cover-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 12px;
    color: var(--slate-400);
}

/* Page Titles */
.pdf-section-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--slate-900);
    margin-bottom: 20px;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-section-title::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: var(--slate-200);
}

.pdf-section-title i {
    color: var(--primary-color);
    font-size: 18px;
}

.pdf-text-p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--slate-700);
    margin-bottom: 16px;
}

/* Dynamic grid layouts in PDF */
.pdf-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 20px;
}

/* Customer Details Block */
.pdf-customer-card {
    background: var(--slate-50);
    border-left: 4px solid var(--primary-color); /* Green line */
    padding: 20px;
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

.pdf-customer-card h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--slate-900);
}

.pdf-customer-card-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 15px;
    font-size: 12px;
}

.pdf-customer-card-grid span:first-child {
    font-weight: 600;
    color: var(--slate-500);
}

.pdf-customer-card-grid span:last-child {
    color: var(--slate-800);
}

/* Dynamic Challenges & Benefits */
.pdf-challenge-item, .pdf-benefit-item {
    background: var(--slate-50);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    border: 1px solid var(--slate-100);
}

.pdf-challenge-item {
    border-left: 3px solid #ef4444; /* red challenge line */
}

.pdf-benefit-item {
    border-left: 3px solid var(--primary-color); /* green benefit line */
}

.pdf-item-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-challenge-item .pdf-item-title i { color: #ef4444; }
.pdf-benefit-item .pdf-item-title i { color: var(--primary-color); }

.pdf-item-desc {
    font-size: 11px;
    color: var(--slate-600);
}

/* Case Study Callout Box */
.pdf-case-study-box {
    background: #f0fdf4; /* Light green */
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-left: 4px solid var(--primary-color);
    padding: 24px;
    border-radius: var(--border-radius-sm);
    margin: 25px 0;
}

.pdf-case-study-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.pdf-case-study-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pdf-case-study-client {
    font-size: 11px;
    font-weight: 700;
    color: var(--slate-500);
}

.pdf-case-study-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pdf-case-study-row {
    font-size: 11px;
    line-height: 1.5;
    color: var(--slate-700);
}

.pdf-case-study-row strong {
    color: var(--slate-900);
}

.pdf-case-study-metrics {
    margin-top: 10px;
    background: white;
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 6px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pdf-case-study-metrics i {
    font-size: 20px;
    color: var(--primary-color);
}

.pdf-case-study-metrics span {
    font-size: 12px;
    font-weight: 800;
    color: var(--primary-dark);
}

/* Proposed Solution Icons & Lists */
.pdf-feature-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.pdf-feature-item {
    display: flex;
    gap: 10px;
}

.pdf-feature-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(34, 197, 94, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.pdf-feature-content h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 2px;
}

.pdf-feature-content p {
    font-size: 10px;
    color: var(--slate-500);
    line-height: 1.4;
}

/* Chatbot Workflow Visual Representation */
.pdf-workflow-diagram {
    background: var(--slate-900);
    color: white;
    border-radius: var(--border-radius-md);
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
}

.pdf-workflow-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary-color);
    text-transform: uppercase;
}

.pdf-workflow-nodes {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.pdf-workflow-node {
    background: var(--slate-800);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    max-width: 120px;
    z-index: 2;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.pdf-workflow-node.start {
    border-color: var(--primary-color);
    background: rgba(34, 197, 94, 0.1);
}

.pdf-workflow-node.end {
    border-color: var(--accent-orange);
    background: rgba(255, 122, 0, 0.1);
}

.pdf-workflow-arrow {
    flex-grow: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
    position: relative;
    z-index: 1;
}

.pdf-workflow-arrow::after {
    content: '\f0da';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: -4px;
    top: -6px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
}

/* Pricing Table in PDF */
.pdf-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.pdf-table th {
    background: var(--slate-900);
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 12px 16px;
    border: 1px solid var(--slate-900);
}

.pdf-table td {
    padding: 12px 16px;
    font-size: 11px;
    border: 1px solid var(--slate-200);
    color: var(--slate-800);
}

.pdf-table tr.total-row td {
    font-weight: 700;
    font-size: 12px;
    background: var(--slate-50);
}

.pdf-table tr.grand-total-row td {
    font-weight: 800;
    font-size: 14px;
    background: rgba(34, 197, 94, 0.05);
    border-top: 2px solid var(--primary-color);
    color: var(--slate-900);
}

.pdf-table tr.grand-total-row td:last-child {
    color: var(--primary-color);
}

/* Trust Blocks */
.pdf-trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.pdf-trust-card {
    border: 1px solid var(--slate-200);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    text-align: center;
}

.pdf-trust-card i {
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.pdf-trust-card h4 {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--slate-900);
}

.pdf-trust-card p {
    font-size: 10px;
    color: var(--slate-500);
}

/* SLA terms block */
.pdf-terms-block {
    background: var(--slate-50);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    font-size: 10px;
    color: var(--slate-600);
    margin-top: 15px;
}

.pdf-terms-block ol {
    margin-left: 20px;
}

.pdf-terms-block li {
    margin-bottom: 6px;
}

/* Signatures & Contact Cards */
.pdf-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-top: 40px;
}

.pdf-sig-block {
    border-top: 1px dashed var(--slate-400);
    padding-top: 15px;
    text-align: center;
}

.pdf-sig-block p:first-child {
    font-size: 12px;
    font-weight: 700;
    color: var(--slate-900);
}

.pdf-sig-block p:last-child {
    font-size: 10px;
    color: var(--slate-500);
    margin-top: 4px;
}

/* Contact Cards in PDF footer */
.pdf-contact-card {
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.pdf-contact-card i {
    font-size: 28px;
    color: var(--primary-color);
}

.pdf-contact-info h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 4px;
}

.pdf-contact-info p {
    font-size: 11px;
    color: var(--slate-600);
    line-height: 1.4;
}


/* --- MOBILE MENU BUTTONS & RESPONSIVE LAYOUTS --- */
.btn-mobile-menu {
    display: none;
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--slate-700);
    cursor: pointer;
    padding: 8px;
    margin-right: 12px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition-smooth);
}

.btn-mobile-menu:hover {
    background: var(--slate-100);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .btn-mobile-menu {
        display: flex;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-viewport {
        width: 100%;
        height: 100vh;
    }
    
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid-full {
        grid-column: span 1;
    }
    
    .plans-selector-grid {
        grid-template-columns: 1fr;
    }
    
    .addons-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-tab-container {
        flex-direction: column;
    }
    
    .settings-nav {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--slate-200);
        margin-bottom: 15px;
    }
    
    .settings-tab-btn {
        white-space: nowrap;
        padding: 8px 16px;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .pdf-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .top-bar {
        padding: 0 15px;
    }
    
    .content-area {
        padding: 15px;
    }
    
    /* PDF Live Preview Overlay fitting */
    .preview-modal-body {
        padding: 15px !important;
        overflow-x: hidden;
        align-items: flex-start;
    }
    
    .proposal-pdf-container {
        transform: scale(0.45);
        transform-origin: top center;
        margin-bottom: -580px;
    }
    
    .preview-modal-window {
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 480px) {
    .proposal-pdf-container {
        transform: scale(0.38);
        transform-origin: top center;
        margin-bottom: -680px;
    }
    
    .top-actions {
        display: none; /* Hide header action button on extra small screens to save space */
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}


/* --- CSS PRINT STYLING PIPELINE --- */
@media print {
    body, .app-container, .top-bar, .sidebar, .content-area, .preview-modal-backdrop, .preview-modal-header, .top-actions, .settings-nav {
        background: transparent !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
    
    .app-container, .sidebar, .top-bar, .content-area, .preview-modal-header {
        display: none !important;
    }

    .preview-modal-backdrop {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: white !important;
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    
    .preview-modal-window {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        background: white !important;
        transform: none !important;
        box-shadow: none !important;
    }
    
    .preview-modal-body {
        padding: 0 !important;
        background: white !important;
    }
    
    .proposal-pdf-container {
        width: 100% !important;
        box-shadow: none !important;
    }
    
    .pdf-page {
        margin-bottom: 0 !important;
        box-shadow: none !important;
        border: none !important;
        page-break-before: always !important;
        width: 210mm !important;
        height: 296mm !important;
        padding: 15mm !important;
        box-sizing: border-box !important;
    }
    
    .pdf-page:first-child {
        page-break-before: avoid !important;
    }
    
    .break-after {
        page-break-after: always !important;
    }
    
    .break-before {
        page-break-before: always !important;
    }
    
    .break-inside-avoid {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }
    
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .pdf-cover-page {
        background: var(--slate-900) !important;
        color: white !important;
    }
    
    .pdf-cover-page * {
        color: white !important;
    }
    
    .pdf-cover-brand i {
        color: var(--primary-color) !important;
    }
    
    .pdf-cover-accent-bar {
        background: var(--primary-color) !important;
    }
    
    .pdf-cover-middle .subtitle {
        color: var(--primary-color) !important;
    }
    
    .pdf-challenge-item {
        border-left: 3px solid #ef4444 !important;
        background: #f8fafc !important;
    }
    
    .pdf-benefit-item {
        border-left: 3px solid #22c55e !important;
        background: #f8fafc !important;
    }
    
    .pdf-customer-card {
        border-left: 4px solid var(--primary-color) !important;
        background: #f8fafc !important;
    }
    
    .pdf-case-study-box {
        background: #f0fdf4 !important;
        border-left: 4px solid var(--primary-color) !important;
        border: 1px solid rgba(34, 197, 94, 0.2) !important;
    }
    
    .pdf-table th {
        background: var(--slate-900) !important;
        color: white !important;
    }
    
    .pdf-table tr.grand-total-row td {
        background: rgba(34, 197, 94, 0.05) !important;
        border-top: 2px solid var(--primary-color) !important;
    }
    
    .pdf-workflow-diagram {
        background: var(--slate-900) !important;
        color: white !important;
    }
}
