:root {
            --navy: #0d174b;
            --navy-2: #16235f;
            --red: #bd3239;
            --white: #ffffff;
            --ink: #1d2333;
            --muted: #5b6377;
            --line: #e2e6ee;
        }

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

        html {
            scroll-behavior: smooth;
        }

        body {
            margin: 0;
            font-family: 'Inter', system-ui, sans-serif;
            color: var(--ink);
            background: #f3f4f6;
            line-height: 1.65;
            -webkit-font-smoothing: antialiased;
        }

        thead th:first-child,
        tbody td:first-child {
            white-space: nowrap;
            min-width: 140px;
        }

        h1,
        h2,
        h3,
        h4,
        .brand,
        .nav-cta,
        .section-title,
        label,
        button {
            font-family: 'Poppins', sans-serif;
        }

        a {
            color: inherit;
            text-decoration: none;
        }

        /* HEADER */
        header {
            position: sticky;
            top: 0;
            z-index: 50;
            background: rgba(13, 23, 75, .97);
            backdrop-filter: blur(8px);
        }

        .nav {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 16px 24px;
            max-width: 1140px;
            margin: 0 auto;
            flex-wrap: wrap;
        }

        .brand {
            font-weight: 700;
            font-size: 22px;
            color: #fff;
            letter-spacing: -.01em;
        }

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

        .nav-links {
            display: flex;
            gap: 26px;
            align-items: center;
        }

        .nav-links a {
            color: #cfd5e6;
            font-size: 14.5px;
            font-weight: 500;
        }

        .nav-links a:hover {
            color: #fff;
        }

        .nav-cta {
            background: var(--red);
            color: #fff !important;
            padding: 10px 20px;
            border-radius: 8px;
            font-weight: 600 !important;
            font-size: 14px;
            margin-left: 8px;
            white-space: nowrap;
        }

        .nav-cta:hover {
            background: #a52a30;
        }

        .burger {
            display: none;
            background: none;
            border: 0;
            cursor: pointer;
            flex-direction: column;
            gap: 5px;
            padding: 6px;
        }

        .burger span {
            width: 24px;
            height: 2px;
            background: #fff;
            display: block;
        }

        .dropdown {
            position: relative;
            display: inline-block;
        }

        .dropbtn {
            display: inline-block;
        }

        .dropdown-content {
            display: none;
            position: absolute;
            min-width: 210px;
            overflow: hidden;
            z-index: 100;
            background: #fff;
            border-radius: 10px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
        }

        .dropdown-content a {
            display: block;
            padding: 12px 16px;
            color: #1e3a8a;
            transition: .3s;
        }

        .dropdown-content a:hover {
            background: #1e3a8a;
            color: #fff;
        }

        .dropdown:hover .dropdown-content {
            display: block;
        }

        /* PAGE */
        .container {
            max-width: 1180px;
            margin: 24px auto;
            background: #fff;
            padding: 28px;
            border-radius: 18px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, .06);
        }

        .page-title {
            font-size: 30px;
            font-weight: 800;
            margin-bottom: 14px;
            color: var(--ink);
            line-height: 1.2;
        }

        /* FORM */
        .form-group {
            margin-bottom: 30px;
        }

        .section-title {
            font-size: 18px;
            font-weight: 700;
            margin-bottom: 20px;
            color: var(--ink);
        }

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

        .income-grid {
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            gap: 28px;
            align-items: start;
            margin-bottom: 30px;
        }

        .income-column .form-group:last-child,
        .result-column .form-group:last-child {
            margin-bottom: 0;
        }

        .result-column {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 22px;
        }

        .result-section.is-hidden {
            display: none;
        }

        .summary-card {
            border: 1px solid var(--line);
            border-radius: 12px;
            padding: 18px;
            background: #f9fafb;
        }

        .summary-card-head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 14px;
        }

        .summary-card-title {
            color: var(--ink);
            font-family: 'Poppins', sans-serif;
            font-size: 14px;
            font-weight: 700;
            line-height: 1.35;
        }

        .card {
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 16px;
            padding: 18px;
            margin-bottom: 18px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, .04);
        }

        .card h2 {
            font-family: 'Poppins', sans-serif;
            font-size: 16px;
            font-weight: 700;
            color: var(--navy);
            margin-bottom: 14px;
        }

        .child-form-grid {
            display: grid;
            grid-template-columns: minmax(180px, 1.5fr) repeat(2, minmax(140px, .75fr));
            gap: 18px;
            align-items: end;
        }

        .percent-badge {
            flex: none;
            min-width: 52px;
            border-radius: 999px;
            background: #e7ecf4;
            color: var(--navy);
            padding: 6px 10px;
            font-family: 'Poppins', sans-serif;
            font-size: 13px;
            font-weight: 700;
            text-align: center;
        }

        .field-note {
            display: block;
            margin-top: 6px;
            color: var(--muted);
            font-family: 'Inter', system-ui, sans-serif;
            font-size: 12px;
            font-weight: 500;
            line-height: 1.5;
        }

        .field-row {
            margin-bottom: 16px;
        }

        .child-form-grid .field-row {
            margin-bottom: 0;
        }

        .field-row label {
            display: block;
            margin-bottom: 6px;
            font-weight: 600;
            color: #374151;
            line-height: 1.35;
        }

        .field-row input {
            width: 100%;
        }

        .fillable-input,
        .modal-field input {
            width: 100%;
            height: 40px;
            border: 1px solid #d1d5db;
            border-radius: 10px;
            padding: 0 12px;
            font-size: 13px;
            transition: all .3s ease;
        }

        .fillable-input:focus,
        .modal-field input:focus {
            border-color: #1e40af;
            box-shadow: 0 0 0 4px rgba(30, 64, 175, .12);
        }

        .w-sm {
            width: 78px !important;
            min-width: 78px;
        }

        .table-wrap {
            overflow-x: auto;
            border-radius: 12px;
            border: 1px solid #e5e7eb;
        }

        .table-intro {
            color: var(--muted);
            font-size: 12px;
            line-height: 1.45;
            margin-bottom: 12px;
        }

        table {
            width: 100%;
            border-collapse: collapse;
        }

        thead {
            background: var(--navy);
        }

        thead th {
            color: white;
            font-size: 12px;
            line-height: 1.3;
            padding: 10px 12px;
            text-align: center;
        }

        tbody tr:nth-child(even) {
            background: #f9fafb;
        }

        tbody td {
            padding: 8px 10px;
            border-bottom: 1px solid #e5e7eb;
            font-size: 13px;
        }

        tbody tr:hover {
            background: #eef4ff;
        }

        .budget-table-wrap {
            overflow-x: auto;
            border: 1px solid var(--line);
            border-radius: 10px;
            background: #fff;
        }

        .budget-table {
            width: 100%;
            min-width: 820px;
            border-collapse: collapse;
        }

        .budget-table th,
        .budget-table td {
            padding: 16px 20px;
            border-bottom: 1px solid #edf0f5;
            text-align: left;
            vertical-align: middle;
        }

        .budget-table th {
            background: #f3f4f6;
            color: #5b6377;
            font-family: 'Poppins', sans-serif;
            font-size: 13px;
            font-weight: 700;
            text-transform: uppercase;
        }

        .budget-table td {
            color: #000;
            font-size: 16px;
        }

        .budget-table .pos-name,
        .budget-table tfoot td {
            font-family: 'Poppins', sans-serif;
            font-weight: 700;
        }

        .budget-table .amount-cell {
            white-space: nowrap;
        }

        .budget-table tfoot td {
            background: #f3f4f6;
            border-bottom: 0;
        }

        label {
            display: block;
            margin-bottom: 10px;
            font-size: 14px;
            font-weight: 600;
            color: var(--ink);
        }

        .input-money {
            display: flex;
            align-items: center;
            border: 1px solid #d1d5db;
            border-radius: 10px;
            overflow: hidden;
            background: #fff;
        }

        .input-money span {
            background: #f9fafb;
            padding: 14px 16px;
            border-right: 1px solid #d1d5db;
            font-size: 14px;
            color: #374151;
        }

        .input-money input {
            width: 100%;
            border: none;
            outline: none;
            padding: 14px 16px;
            font-size: 14px;
            color: #111827;
        }

        .input-money input::placeholder {
            color: #9ca3af;
        }

        .input-money:has(input:disabled) {
            background: #f3f4f6;
            opacity: .72;
        }

        .input-money input:disabled {
            cursor: not-allowed;
            background: #f3f4f6;
        }

        .input-money input[readonly] {
            background: #f9fafb;
            cursor: default;
        }

        .access-note {
            padding: 10px 12px;
            margin-bottom: 18px;
            border: 1px solid #bfdbfe;
            border-radius: 10px;
            background: #eff6ff;
            color: #1e40af;
            font-size: 12px;
            line-height: 1.5;
        }

        .access-note strong {
            font-weight: 700;
        }

        /* BUTTON */
        .btn-submit {
            width: 100%;
            border: none;
            background: var(--red);
            color: #fff;
            padding: 16px;
            border-radius: 10px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            margin-top: 16px;
            transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
            box-shadow: 0 8px 22px rgba(189, 50, 57, .3);
        }

        .btn-submit:hover {
            background: #a52a30;
            transform: translateY(-2px);
        }

        #openIdentityForm {
            background: var(--navy);
            box-shadow: 0 8px 22px rgba(13, 23, 75, .28);
        }

        #openIdentityForm:hover {
            background: var(--navy-2);
        }

        .modal-overlay {
            position: fixed;
            inset: 0;
            z-index: 2000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background: rgba(17, 24, 39, .62);
        }

        .modal-overlay.is-open {
            display: flex;
        }

        .identity-modal {
            width: 100%;
            max-width: 520px;
            background: #fff;
            border-radius: 18px;
            box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
            padding: 28px;
        }

        .identity-modal h2 {
            margin: 0 0 8px;
            font-size: 24px;
            color: var(--ink);
            line-height: 1.2;
        }

        .identity-modal p {
            margin: 0 0 24px;
            color: #6b7280;
            font-size: 14px;
            line-height: 1.6;
        }

        .identity-field {
            margin-bottom: 18px;
        }

        .identity-field input {
            width: 100%;
            box-sizing: border-box;
            border: 1px solid #d1d5db;
            border-radius: 10px;
            padding: 14px 16px;
            font-size: 14px;
            outline: none;
        }

        .identity-field input:focus {
            border-color: #2563eb;
            box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
        }

        .modal-actions {
            display: flex;
            gap: 12px;
            margin-top: 8px;
        }

        .modal-actions>button {
            flex: 1;
            width: auto;
            height: 60px;
            min-height: 60px;
            padding: 0 16px;
            border-radius: 10px;
            font-size: 15px;
            font-weight: 600;
            margin-top: 0 !important;
            box-shadow: none;
        }

        .btn-secondary {
            width: 100%;
            border: 1px solid #d1d5db;
            background: #fff;
            color: var(--ink);
            padding: 14px;
            border-radius: 10px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
        }

        .btn-secondary:hover {
            background: #f9fafb;
        }

        .inline-input {
            display: flex;
            align-items: center;
        }

        .inline-input input {
            flex: 1;
        }

        .inline-input span {
            min-width: 50px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid #d1d5db;
            border-left: 0;
            border-radius: 0 10px 10px 0;
            background: #f3f4f6;
            font-size: 12px;
            font-weight: 600;
        }

        .inline-input input {
            border-radius: 10px 0 0 10px;
        }

        @media(max-width:900px) {

            .form-grid {
                grid-template-columns: 1fr;
            }

            .income-grid,
            .result-column {
                grid-template-columns: 1fr;
            }

            .nav-links {
                position: fixed;
                top: 62px;
                left: 0;
                right: 0;
                background: var(--navy);
                flex-direction: column;
                align-items: flex-start;
                padding: 18px 24px;
                gap: 16px;
                display: none;
                border-top: 1px solid rgba(255, 255, 255, .1);
            }

            .nav-links.open {
                display: flex;
            }

            .burger {
                display: flex;
            }

            .dropdown,
            .dropdown-content {
                width: 100%;
            }

            .dropdown-content {
                position: static;
                margin-top: 10px;
            }

            .page-title {
                font-size: 25px;
            }

            .container {
                width: auto;
                margin: 20px 14px;
                padding: 22px;
            }

            .modal-actions {
                flex-direction: column-reverse;
            }

            .hint {
                display: block;
                font-size: 11px;
                color: #6b7280;
                margin-top: 2px;
            }

        }

        @media(max-width:768px) {
            .child-form-grid {
                grid-template-columns: 1fr;
            }
        }
