* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 1400px;
    margin: 0 auto;
    overflow: hidden;
    animation: slideIn 0.6s ease-out;
    display: flex;
    min-height: 600px;
    width: 1100px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.content-body {
    display: flex;
    flex: 1;
}

/* Header */
.header {
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
    color: white;
    padding: 20px 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    border-radius: 10px 10px 0 0;
    width: 1100px;
    margin-top: -26px;
    margin-left: -25px;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
}

.header .nit {
    font-size: 14px;
    opacity: 0.9;
}

/* Left Section - Table */
.table-section {
    flex: 1;
    padding-right: 25px;
    border-right: 1px solid #e5e7eb;
}

/* Right Section - Controls */
.controls-section {
    width: 300px;
    padding-left: 25px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    flex-direction: column;
    gap: 20px;
    border-radius: 8px;
    margin-left: 20px;
}

/* Table */
.tabla {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    height: fit-content;
}

.tabla-header {
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
    color: white;
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    font-weight: 600;
    font-size: 14px;
}

.tabla-header div {
    padding: 15px 12px;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.tabla-header div:last-child {
    border-right: none;
}

.tabla-body {
    background: white;
}

.tabla-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.tabla-row:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.tabla-row div {
    padding: 12px;
    display: flex;
    align-items: center;
    font-size: 13px;
    border-right: 1px solid #e5e7eb;
}

.tabla-row div:last-child {
    border-right: none;
}

.tabla-row .codigo {
    justify-content: center;
    font-family: "Courier New", monospace;
    font-weight: 600;
    color: #4338ca;
}

.tabla-row .cuenta {
    font-weight: 500;
    color: #374151;
}

.tabla-row .importe {
    justify-content: flex-end;
    font-family: "Courier New", monospace;
    font-weight: 600;
    color: #059669;
}

/* Date Controls */
.date-controls {
    margin-top: 10px;
    flex-direction: column;
    gap: 15px;
}

.date-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.date-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.date-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.date-field {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.date-numero {
    width: 50px;
    padding: 8px 6px;
    text-align: center;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}

.date-spinner {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.spinner-btn {
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.spinner-btn:hover {
    transform: scale(1.1);
}

/* Form Fields */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 255px;
}

.form-field label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.form-field select {
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: inherit;
    background: white;
}

.form-field select:focus {
    outline: none;
    border-color: #4338ca;
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.1);
}

/* Cargar Button */
.cargar-btn {
    background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
    color: white;
    border: none;
    width: 255px;
    margin-top: 10px;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(67, 56, 202, 0.3);
    font-size: 14px;
}

.cargar-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 56, 202, 0.4);
}

.cargar-btn:active {
    transform: translateY(0);
}

/* Balance Fields */
.balance-fields {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.balance-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-left: -20px;
    padding: 15px;
    width: 290px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.balance-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.balance-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    min-width: 80px;
}

.balance-field input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.3s ease;
    font-family: "Courier New", monospace;
    text-align: right;
    background: #f9fafb;
    width: 100px;
}

.balance-field input:focus {
    outline: none;
    border-color: #4338ca;
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.1);
}

/* Equation Field */
.equation-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: 8px;
    border: 2px solid #a7f3d0;
}

.equation-field label {
    font-size: 13px;
    font-weight: 600;
    color: #065f46;
    min-width: 120px;
}

.equation-field input {
    margin-left: -50px;
    width: 150px;
    padding: 8px 12px;
    border: 2px solid #a7f3d0;
    border-radius: 6px;
    font-size: 13px;
    font-family: "Courier New", monospace;
    text-align: right;
    background: white;
    color: #065f46;
    font-weight: 600;
}

/* Bottom Buttons */
.bottom-buttons {
    gap: 10px;
    margin-left: 70px;
    margin-top: 10px;
    padding-top: 20px;
}

.bottom-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
}

.pdf-btn {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.excel-btn {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.bottom-btn:hover {
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .container {
        min-height: auto;
    }

    .main-content {
        padding: 20px 15px;
    }

    .header {
        padding: 15px 20px;
        text-align: center;
        margin-bottom: 20px;
    }

    .content-body {
        flex-direction: column;
    }

    .table-section {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding-right: 0;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .controls-section {
        width: 100%;
        padding-left: 0;
        margin-left: 0;
    }

    .tabla-header {
        grid-template-columns: 1fr;
        font-size: 12px;
    }

    .tabla-header div {
        padding: 12px 10px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .tabla-row {
        grid-template-columns: 1fr;
    }

    .tabla-row div {
        padding: 10px;
        border-right: none;
        border-bottom: 1px solid #f3f4f6;
        justify-content: flex-start !important;
    }

    .date-inputs {
        flex-wrap: wrap;
        gap: 5px;
    }

    .date-numero {
        width: 45px;
        padding: 6px 4px;
    }

    .spinner-btn {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }

    .balance-field {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }

    .balance-field label {
        min-width: auto;
    }

    .equation-field {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .equation-field label {
        min-width: auto;
    }

    .bottom-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .bottom-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .controls-section {
        width: 280px;
    }

    .tabla-header {
        font-size: 13px;
    }

    .tabla-header div {
        padding: 12px 8px;
    }

    .tabla-row div {
        padding: 10px 8px;
        font-size: 12px;
    }
}

@media (min-width: 1441px) {
    .container {
        max-width: 1600px;
    }

    .main-content {
        padding: 30px;
    }

    .controls-section {
        width: 350px;
        padding-left: 30px;
    }

    .table-section {
        padding-right: 30px;
    }

    .tabla-header div {
        padding: 18px 15px;
        font-size: 15px;
    }

    .tabla-row div {
        padding: 15px;
        font-size: 14px;
    }

    .date-numero {
        width: 55px;
        padding: 10px 8px;
        font-size: 14px;
    }

    .spinner-btn {
        width: 22px;
        height: 22px;
        font-size: 13px;
    }

    .cargar-btn {
        padding: 14px 24px;
        font-size: 15px;
    }

    .bottom-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}

@media (min-width: 1921px) {
    .container {
        max-width: 1800px;
    }

    .main-content {
        padding: 40px;
    }

    .header {
        padding: 25px 30px;
    }

    .header h1 {
        font-size: 20px;
    }

    .controls-section {
        width: 400px;
        padding-left: 40px;
    }

    .table-section {
        padding-right: 40px;
    }

    .tabla-header div {
        padding: 20px 18px;
        font-size: 16px;
    }

    .tabla-row div {
        padding: 18px;
        font-size: 15px;
    }

    .date-numero {
        width: 60px;
        padding: 12px 10px;
        font-size: 15px;
    }

    .spinner-btn {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .cargar-btn {
        padding: 16px 28px;
        font-size: 16px;
    }

    .bottom-btn {
        padding: 14px 24px;
        font-size: 15px;
    }
}

/* Scroll for table */
.table-section {
    overflow-x: auto;
}

.tabla {
    min-width: 500px;
}
