:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --success-color: #10b981;
    --border-color: rgba(148, 163, 184, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.container {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2rem;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    animation: fadeIn 0.6s ease-out backwards;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

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

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-help {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.6rem;
    color: white;
    font-size: 1rem;
    transition: all 0.2s ease;
}

input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    transform: scale(1.01);
}

/* Hide number input spinner buttons */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

input[type=number] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}




.separator {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 0.5rem 1rem;
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.2);
    border-color: var(--text-secondary);
    transform: scale(1.05);
}

/* Results */
.hidden {
    display: none;
}

.kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
}

.summary-item {
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.highlight {
    color: var(--success-color);
    font-size: 1.5rem;
    font-weight: 800;
}

.summary-caption {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

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

.results-table th,
.results-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.results-table th {
    color: var(--text-secondary);
}

.text-right {
    text-align: right;
    font-family: monospace;
    font-size: 1.1em;
}

.grand-total {
    font-family: monospace;
    font-size: 1.4em;
    color: var(--success-color);
    font-weight: bold;
    text-align: right;
}

.separator-row td {
    border-top: 2px solid var(--border-color);
}

/* Color-coded payroll input blocks */
.block-salary-base {
    background: rgba(59, 130, 246, 0.08) !important;
    /* Blue tint */
    border-left: 4px solid rgba(59, 130, 246, 0.6);
}

.block-paga-extra {
    background: rgba(16, 185, 129, 0.08) !important;
    /* Green tint */
    border-left: 4px solid rgba(16, 185, 129, 0.6);
}

.block-overtime {
    background: rgba(245, 158, 11, 0.08) !important;
    /* Amber tint */
    border-left: 4px solid rgba(245, 158, 11, 0.6);
}

.block-factor-mayor {
    background: rgba(168, 85, 247, 0.08) !important;
    /* Purple tint */
    border-left: 4px solid rgba(168, 85, 247, 0.6);
}

/* Tab Navigation Styles */
.tab-container {
    margin-top: 2rem;
}

.tab-navigation {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    overflow-x: auto;
    scrollbar-width: thin;
}

.tab-button {
    padding: 1rem 2rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.tab-button:hover {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.05);
}

.tab-button.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.08);
}

.tab-button::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-button.active::before {
    transform: scaleX(1);
}

.tab-content {
    display: none;
    animation: fadeInTab 0.4s ease-out;
}

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

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Common header section */
.common-header {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1rem;
}

/* Mobile responsive tabs */
@media (max-width: 768px) {
    .tab-button {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .tab-navigation {
        gap: 0.25rem;
    }
}

/* Result Blocks Visual Separation */
.result-block-base {
    background: rgba(59, 130, 246, 0.05) !important;
    /* Blue tint */
    border-bottom: 2px solid rgba(59, 130, 246, 0.2);
}

.result-block-extra {
    background: rgba(16, 185, 129, 0.05) !important;
    /* Green tint */
    border-bottom: 2px solid rgba(16, 185, 129, 0.2);
}

.result-block-overtime {
    background: rgba(245, 158, 11, 0.05) !important;
    /* Amber tint */
    border-bottom: 2px solid rgba(245, 158, 11, 0.2);
}

.result-block-factors {
    background: rgba(168, 85, 247, 0.05) !important;
    /* Purple tint */
    border-bottom: 2px solid rgba(168, 85, 247, 0.2);
}

/* Add spacing between tbodies */
.results-table tbody::before {
    content: '';
    display: block;
    height: 1rem;
    /* Spacing between blocks */
    background: transparent;
}