:root {
    --primary-color: #0066cc;
    --border-color: #d1d5db;
    --bg-gray: #f9fafb;
    --text-gray: #64748b;
    --font-family: 'Inter', sans-serif;
    --input-bg: #fef3c7;
    --input-border: #fbbf24;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-gray);
    color: #1e293b;
    padding: 24px;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: #fff;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Header */
.header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #0f172a;
}

.controls-row {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.year-manager {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.year-manager label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-gray);
}

.year-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.year-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #15803d;
}

.year-chip .remove-btn {
    background: none;
    border: none;
    color: #15803d;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    margin-left: 2px;
}

.year-chip .remove-btn:hover {
    color: #dc2626;
}

.btn-add-year {
    padding: 6px 12px;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    color: var(--text-gray);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-year:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Sections */
.sections-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.section {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 32px;
}

.section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #0f172a;
}

.section-note {
    font-size: 13px;
    color: #475569;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* Tables */
.tax-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tax-table th,
.tax-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.tax-table thead th {
    font-weight: 600;
    background: #f8fafc;
    color: #475569;
    text-align: right;
    font-size: 13px;
    border-bottom: 2px solid var(--border-color);
}

.tax-table thead th:first-child {
    text-align: left;
}

.tax-table .unit-header {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-gray);
    display: block;
}

/* Row types */
.tax-table .label-cell {
    font-weight: 500;
    color: #334155;
}

.tax-table .label-cell.indent {
    padding-left: 32px;
    font-weight: 400;
}

.tax-table .label-cell.indent-2 {
    padding-left: 48px;
    font-weight: 400;
}

.tax-table .highlight-row {
    background: #fef9c3;
    font-weight: 600;
}

.tax-table .highlight-row .label-cell {
    font-weight: 600;
}

/* Number cells */
.tax-table .number-cell {
    text-align: right;
    padding: 0;
}

/* Input cells */
.tax-table input.cell-input {
    width: 100%;
    height: 100%;
    padding: 10px 12px;
    border: 2px solid transparent;
    background: var(--input-bg);
    text-align: right;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.15s;
    box-sizing: border-box;
}

.tax-table input.cell-input:hover {
    background: var(--input-bg);
    border-color: var(--input-border);
}

.tax-table input.cell-input:focus {
    outline: none;
    background: #fffbeb;
    border-color: #2563eb;
    box-shadow: inset 0 0 0 1px #2563eb;
    z-index: 1;
}

/* Calculated cells */
.tax-table .calculated-cell {
    padding: 10px 12px;
    text-align: right;
    font-weight: 500;
    color: #334155;
}

.tax-table .total-row {
    border-top: 2px solid #94a3b8;
}

.tax-table .total-row .calculated-cell,
.tax-table .total-row .label-cell {
    font-weight: 700;
}

.tax-table .subtotal-row {
    border-top: 1px solid #cbd5e1;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-gray);
    line-height: 1;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #475569;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: #0052a3;
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

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