* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #eff6ff 0%, #fff 50%, #edf8f0 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 24px 30px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 24px;
    margin-bottom: 6px;
    font-weight: 700;
}

.header p {
    font-size: 13px;
    opacity: 0.9;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 968px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}

.card h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #1f2937;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h2 {
    margin: 0;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
}

.btn-add {
    background: #9333ea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-add:hover {
    background: #7e22ce;
}

.child-item {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.child-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.child-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: #374151;
}

.btn-remove {
    background: transparent;
    color: #ef4444;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-remove:hover {
    background: #fee2e2;
}

.child-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.form-group-inline {
    display: flex;
    flex-direction: column;
}

.form-group-inline label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
}

.form-group-inline select {
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    padding: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.slider-container {
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.1);
}

.slider-container label {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
    color: #92400e;
    font-size: 14px;
}

.slider-container label .valid {
    color: #16a34a;
}

.slider-container label .invalid {
    color: #dc2626;
}

.slider {
    width: 100%;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(to right, 
        #d1d5db 0%, #d1d5db 30%, 
        #fbbf24 30%, #fbbf24 50%, 
        #f97316 50%, #f97316 75%, 
        #dc2626 75%, #dc2626 100%);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid #f59e0b;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid #f59e0b;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.slider-marks {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #92400e;
    margin-top: 6px;
    font-weight: 600;
}

.warning, .success {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.warning {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #dc2626;
}

.success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #16a34a;
}

.result-boxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.box {
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.box.blue {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #60a5fa;
}

.box.green {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 2px solid #4ade80;
}

.box span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: #1f2937;
    letter-spacing: 0.5px;
}

.box strong {
    font-size: 28px;
    font-weight: 900;
    color: #1f2937;
    display: block;
    line-height: 1;
}

.box small {
    display: block;
    font-size: 11px;
    color: #6b7280;
    margin-top: 6px;
    font-weight: 600;
}

.total {
    background: linear-gradient(135deg, #9333ea 0%, #a855f7 100%);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    color: white;
    margin-bottom: 24px;
    box-shadow: 0 8px 20px rgba(147, 51, 234, 0.3);
}

.total h3 {
    font-size: 16px;
    margin-bottom: 12px;
    opacity: 0.95;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.total small {
    font-size: 13px;
    opacity: 0.9;
    display: block;
    margin-top: 8px;
}

.amount {
    font-size: 52px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.breakdown {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.breakdown h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 18px;
    color: #1f2937;
}

.breakdown-section {
    margin-bottom: 18px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.breakdown-section:last-child {
    margin-bottom: 0;
}

.breakdown-section.highlight {
    background: linear-gradient(135deg, #fef9e7 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
}

.breakdown .item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.breakdown .item span {
    color: #374151;
    font-weight: 600;
}

.breakdown .item strong {
    color: #1f2937;
    font-weight: 700;
    font-size: 16px;
}

.detail-info {
    background: white;
    padding: 14px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 13px;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.children-breakdown {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #e5e7eb;
}

.child-line {
    padding: 8px 0;
    font-size: 13px;
    color: #4b5563;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.child-line.total-base {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #d1d5db;
    font-weight: 700;
    color: #1f2937;
    font-size: 14px;
}

.disability-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #fbbf24;
}

.note {
    display: block;
    margin-top: 10px;
    padding: 10px;
    background: #fef2f2;
    border-radius: 6px;
    font-size: 11px;
    color: #991b1b;
    font-style: italic;
    border: 1px solid #fca5a5;
}

.total-line {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    padding: 14px;
    border-radius: 10px;
    border: 2px solid #22c55e;
    font-weight: 700;
    margin-top: 14px;
    font-size: 15px;
}

.buttons-center {
    text-align: center;
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-modal {
    background: #16a34a;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.btn-modal:hover {
    background: #15803d;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.4);
}

.btn-modal.secondary {
    background: #4f46e5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-modal.secondary:hover {
    background: #4338ca;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-modal.pdf {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-modal.pdf:hover {
    background: #b91c1c;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    font-size: 22px;
    margin-bottom: 8px;
    color: #1f2937;
    padding-right: 40px;
}

.modal-content .subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
    color: #9ca3af;
    transition: color 0.2s;
    line-height: 1;
}

.close:hover {
    color: #374151;
}

.info-content {
    line-height: 1.7;
}

.info-content p {
    margin-bottom: 14px;
    color: #4b5563;
}

.info-content h3 {
    font-size: 16px;
    margin: 20px 0 12px 0;
    color: #1f2937;
}

.info-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 14px;
}

.info-content ul li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: #4b5563;
}

.info-content ul li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #16a34a;
    font-weight: bold;
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 1100px;
}

th, td {
    border: 1px solid #e5e7eb;
    padding: 14px 10px;
    text-align: center;
}

thead th {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: white;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr:nth-child(even) {
    background: #f9fafb;
}

tbody tr:hover {
    background: #f0fdf4;
    transition: background 0.2s;
}

tbody td {
    font-size: 13px;
    color: #374151;
}

tbody td:first-child {
    font-weight: 700;
    color: #16a34a;
    font-size: 14px;
}

tbody td small {
    display: block;
    font-size: 10px;
    color: #6b7280;
    margin-top: 3px;
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 20px;
    }
    
    .card {
        padding: 16px;
    }
    
    .child-form {
        grid-template-columns: 1fr;
    }
    
    .result-boxes {
        grid-template-columns: 1fr;
    }
    
    .box strong {
        font-size: 24px;
    }
    
    .amount {
        font-size: 40px;
    }
    
    .btn-modal {
        width: 100%;
    }
    
    .modal-content {
        padding: 20px;
        max-width: 96%;
    }
    
    .buttons-center {
        flex-direction: column;
    }
}