:root {
            /* Modern color palette */
            --primary: #274c77;
            --primary-dark: #047857;
            --secondary: #6096ba;
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --info: #0ea5e9;
            
            /* Light theme */
            --bg-primary: #ffffff;
            --bg-secondary: #f8fafc;
            --bg-tertiary: #f1f5f9;
            --text-primary: #1e293b;
            --text-secondary: #475569;
            --text-muted: #64748b;
            --accent-primary: #274c77;
            --accent-secondary: #6096ba;
            --accent-success: #10b981;
            --accent-warning: #f59e0b;
            --accent-danger: #ef4444;
            --border-light: #e2e8f0;
            --border-medium: #cbd5e1;
            --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
            --radius-sm: 0.375rem;
            --radius-md: 0.5rem;
            --radius-lg: 0.75rem;
            --radius-xl: 1rem;
            --radius-2xl: 1.5rem;
        }

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

        html {
            scroll-behavior: smooth;
            font-size: 16px;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background-color: var(--bg-primary);
            color: var(--text-primary);
            line-height: 1.6;
            transition: background-color 0.3s ease, color 0.3s ease;
            min-height: 100vh;
            overflow-x: hidden;padding-top: 70px;
        }

        /* Typography */
        h1, h2, h3, h4, h5, h6 {
            font-family: 'Poppins', sans-serif;
            font-weight: 600;
            line-height: 1.2;
        }

        .container {
            width: 100%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 1rem;
        }

        /* Header */
        .headernew {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px;
            position: relative;
        }

        .logo-text h1 {
            font-size: 1.25rem;
            font-weight: 700;
            line-height: 1.2;
        }

        .logo-text p {
            color: var(--text-muted);
            font-size: 1rem;
        }

        @media (min-width: 640px) {
            
            .logo-text h1 {
                font-size: 1.5rem;
            }
            
            .logo-text p {
                display: block;
                font-size: 0.875rem;
            }
        }

        .theme-toggle {
            background: transparent;
            border: none;
            border-radius: var(--radius-md);
            padding: 0.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            cursor: pointer;
            transition: all 0.2s ease;
            color: var(--text-secondary);
        }

        .theme-toggle:hover {
            color: var(--accent-primary);
            transform: translateY(-1px);
        }

        .theme-toggle svg {
            width: 1.25rem;
            height: 1.25rem;
        }

        /* Main Grid Layout - Mobile First */
        .main-grid {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
            margin: 1.5rem 0 2rem;
        }

        @media (min-width: 1024px) {
            .main-grid {
                display: grid;
                grid-template-columns: 2fr 1fr;
                gap: 2rem;
            }
        }

        /* Cards */
        .card {
            background: var(--bg-secondary);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-md);
            padding: 1.25rem;
            margin-bottom: 1.25rem;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        @media (min-width: 640px) {
            .card {
                padding: 1.5rem;
            }
        }

        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.25rem;
        }

        .card-title {
            font-size: 1.125rem;
            font-weight: 600;
            color: var(--text-primary);
        }

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

        /* COMPACT FORM LAYOUT - Improved Input Groups */
        .form-row {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1rem;
            margin-bottom: 1.25rem;
        }

        @media (min-width: 640px) {
            .form-row {
                grid-template-columns: repeat(2, 1fr);
                gap: 1.25rem;
            }
            
            .form-row.full-width {
                grid-template-columns: 1fr;
            }
        }

        .form-group {
            margin-bottom: 0;
            width: 100%;
        }

        .form-label {
            display: flex;
            align-items: center;
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--text-secondary);
            margin-bottom: 0.5rem;
        }

        /* COMPACT INPUT GROUP - All in one line */
        .compact-input-group {
            display: flex;
            align-items: center;
            background: var(--bg-primary);
            border: 1px solid var(--border-light);
            border-radius: var(--radius-md);
            overflow: hidden;
            transition: all 0.2s ease;
        }

        .compact-input-group:focus-within {
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
        }

        .compact-input-group .input-prepend {
            padding: 0.75rem 1rem;
            background: var(--bg-tertiary);
            color: var(--text-muted);
            font-size: 0.875rem;
            font-weight: 500;
            white-space: nowrap;
            border-right: 1px solid var(--border-light);
        }

        .compact-input-group .input-append {
            padding: 0.75rem 1rem;
            background: var(--bg-tertiary);
            color: var(--text-muted);
            font-size: 0.875rem;
            font-weight: 500;
            white-space: nowrap;
            border-left: 1px solid var(--border-light);
        }

        .compact-input-group input {
            flex: 1;
            min-width: 0;
            padding: 0.75rem 1rem;
            background: transparent;
            border: none;
            font-size: 1rem;
            color: var(--text-primary);
            outline: none;
            width: 100%;
        }

        .compact-input-group select {
            flex: 1;
            min-width: 0;
            padding: 0.75rem 1rem;
            background: transparent;
            border: none;
            font-size: 1rem;
            color: var(--text-primary);
            outline: none;
            cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 1rem center;
            background-size: 1rem;
            padding-right: 2.5rem;
        }

        .compact-input-group input[type="number"]::-webkit-outer-spin-button,
        .compact-input-group input[type="number"]::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        /* Form hints */
        .form-hint {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 0.25rem;
            line-height: 1.4;
        }

        /* Buttons - Touch Friendly */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            padding: 0.875rem 1.5rem;
            border-radius: var(--radius-md);
            font-weight: 600;
            font-size: 0.875rem;
            cursor: pointer;
            transition: all 0.2s ease;
            border: none;
            min-height: 44px;
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: white;
            box-shadow: var(--shadow-md);
        }

        .btn-primary:hover, .btn-primary:active {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        .btn-secondary {
            background: var(--bg-tertiary);
            color: var(--text-secondary);
            border: 1px solid var(--border-light);
        }

        .btn-secondary:hover, .btn-secondary:active {
            background: var(--border-light);
        }

        .btn-group {
            display: grid;
            grid-template-columns: 1fr;
            gap: 0.75rem;
            margin-top: 1.5rem;
        }

        @media (min-width: 640px) {
            .btn-group {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        /* Results Grid - Mobile Stacked */
        .results-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.8rem;
            margin-bottom: 1.5rem;
        }


        @media (min-width: 640px) {
            .results-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (min-width: 1024px) {
            .results-grid {
                grid-template-columns: repeat(4, 1fr);
            }
        }

        .result-card {
            background: var(--bg-primary);
            border-radius: var(--radius-lg);
            padding: 1.25rem;
            text-align: center;
            box-shadow: var(--shadow-sm);
        }

        .result-card.highlight {
            background: linear-gradient(135deg, rgba(5, 150, 105, 0.1), transparent);
            border: 2px solid var(--accent-primary);
        }

        .result-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-bottom: 0.5rem;
        }

        .result-value {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--accent-primary);
            margin-bottom: 0.5rem;
        }

        @media (min-width: 768px) {
            .result-value {
                font-size: 1.75rem;
            }
        }

        .result-card.highlight .result-value {
            color: var(--accent-primary);
        }

        .result-subvalue {
            font-size: 0.70rem;
            color: var(--text-muted);
        }

        /* Charts - Mobile Responsive */
        .chart-container {
            position: relative;
            height: 250px;
            margin-bottom: 1.5rem;
        }

        @media (min-width: 768px) {
            .chart-container {
                height: 300px;
            }
        }

        /* Tabs */
        .tabs {
            display: flex;
            border-bottom: 1px solid var(--border-light);
            margin-bottom: 1.5rem;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        .tab {
            padding: 0.75rem 1.5rem;
            background: transparent;
            border: none;
            color: var(--text-muted);
            font-weight: 500;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            transition: all 0.2s ease;
            white-space: nowrap;
        }

        .tab.active {
            color: var(--accent-primary);
            border-bottom-color: var(--accent-primary);
        }

        .tab-content {
            display: none;
        }

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

        /* Progress Section */
        .progress-section {
            margin-bottom: 1.5rem;
        }

        .progress-bar {
            height: 8px;
            background: var(--bg-tertiary);
            border-radius: var(--radius-sm);
            overflow: hidden;
            margin-bottom: 0.5rem;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--primary), var(--secondary));
            border-radius: var(--radius-sm);
            transition: width 0.5s ease;
        }

        .progress-labels {
            display: flex;
            justify-content: space-between;
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        @media (min-width: 1024px) {
            .sidebar-column {
                display: block;
            }
        }

        .sidebar-section {
            margin-bottom: 1.5rem;
        }

        .history-list {
            max-height: 300px;
            overflow-y: auto;
        }

        .history-item {
            padding: 0.875rem;
            border-radius: var(--radius-md);
            background: var(--bg-primary);
            margin-bottom: 0.75rem;
            cursor: pointer;
            transition: all 0.2s ease;
            border-left: 3px solid var(--accent-primary);
        }

        .history-item:hover {
            background: var(--bg-tertiary);
        }

        .history-title {
            font-weight: 600;
            margin-bottom: 0.25rem;
            font-size: 0.875rem;
        }

        .history-details {
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        /* FAQ Items */
        .faq-item {
            margin-bottom: 1rem;
            border-bottom: 1px solid var(--border-light);
            padding-bottom: 1rem;
        }

        .faq-item:last-child {
            margin-bottom: 0;
            border-bottom: none;
            padding-bottom: 0;
        }

        .faq-question {
            font-weight: 600;
            margin-bottom: 0.5rem;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .faq-answer {
            font-size: 0.875rem;
            color: var(--text-muted);
            line-height: 1.5;
        }

        /* Tooltips */
        .tooltip {
            position: relative;
            display: inline-block;
        }

        .tooltip .tooltip-text {
            visibility: hidden;
            width: 280px;
            background-color: var(--bg-secondary);
            color: var(--text-primary);
            text-align: left;
            border-radius: var(--radius-md);
            padding: 0.75rem;
            position: absolute;
            z-index: 1;
            bottom: 125%;
            left: 50%;
            transform: translateX(-50%);
            opacity: 0;
            transition: opacity 0.3s;
            box-shadow: var(--shadow-lg);
            font-size: 0.875rem;
            line-height: 1.5;
        }

        .tooltip:hover .tooltip-text {
            visibility: visible;
            opacity: 1;
        }

        .info-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: var(--bg-tertiary);
            color: var(--text-muted);
            font-size: 0.75rem;
            margin-left: 0.25rem;
            cursor: help;
        }

        /* Loading Spinner */
        .spinner {
            display: none;
            width: 40px;
            height: 40px;
            border: 3px solid var(--border-light);
            border-top-color: var(--accent-primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto;
        }

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

        /* Print Styles */
        @media print {
            .header .headernew, .sidebar-column, .btn-group, .mobile-ad, .mobile-menu-toggle, .theme-toggle, .tabs {
                display: none !important;
            }
            
            .card {
                box-shadow: none;
                border: 1px solid #ccc;
            }
            
            .main-grid {
                display: block;
            }
            
            .chart-container {
                height: 200px;
            }
        }

        /* Touch device optimizations */
        @media (hover: none) and (pointer: coarse) {
            .btn:active {
                transform: scale(0.98);
            }
            
            .compact-input-group:focus-within {
                box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
            }
        }

        /* Prevent zoom on input focus for iOS */
        @media (max-width: 768px) {
            .compact-input-group input,
            .compact-input-group select {
                font-size: 16px;
            }
        }