/* ...los estilos anteriores igual... */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #3b82f6 100%);
    min-height: 100vh;
    color: white;
    padding: 20px;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
}
.header {
    text-align: center;
    margin-bottom: 40px;
}
.header h1 {
    font-size: 3rem;
    font-weight: bold;
    color: #60a5fa;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.header p {
    font-size: 1.2rem;
    color: #cbd5e1;
    opacity: 0.9;
}
.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    align-items: start;
}
.transaction-section,
.stock-section {
    background: rgba(30, 41, 59, 0.8);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* ------------ NUEVO HISTORIAL ----------- */
.history-section {
    margin-top: 40px;
    background: rgba(30, 41, 59, 0.85);
    border-radius: 16px;
    padding: 32px 24px 24px 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 10px;
}
.history-header h2 {
    color: #60a5fa;
    font-size: 1.45rem;
    margin-bottom: 3px;
}
.history-header p {
    font-size: 0.97rem;
    color: #94a3b8;
}
.export-btn {
    background: #2563eb;
    color: white;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(59,130,246,0.14);
    transition: background 0.20s;
    display: flex;
    align-items: center;
    gap: 7px;
}
.export-btn:hover {
    background: #1e40af;
}
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}
.history-table th,
.history-table td {
    padding: 10px 7px;
    text-align: left;
}
.history-table th {
    background-color: rgba(59, 130, 246, 0.18);
    color: #bae6fd;
    font-size: 1rem;
    font-weight: 600;
}
.history-table td {
    font-size: 1rem;
    color: #f1f5f9;
    border-bottom: 1px solid rgba(100, 116, 139, 0.16);
}
.tipo-venta {
    background: #dc2626;
    color: #fff;
    border-radius: 8px;
    padding: 3px 13px;
    display: inline-block;
    font-size: .96em;
    font-weight: 600;
    letter-spacing: .5px;
}
.tipo-compra {
    background: #16a34a;
    color: #fff;
    border-radius: 8px;
    padding: 3px 13px;
    display: inline-block;
    font-size: .96em;
    font-weight: 600;
    letter-spacing: .5px;
}
.history-footer {
    color: #cbd5e1;
    font-size: .96rem;
    text-align: right;
    opacity: 0.78;
}
/* ----------- / FIN HISTORIAL ----------- */

.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.icon {
    font-size: 2rem;
    opacity: 0.8;
}
.section-header h2 {
    font-size: 1.5rem;
    color: #60a5fa;
    margin-bottom: 4px;
}
.section-header p {
    color: #94a3b8;
    font-size: 0.9rem;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #e2e8f0;
    font-weight: 500;
}
.form-group select,
.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(51, 65, 85, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}
.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}
.form-group option {
    background: #334155;
    color: white;
}
.register-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.register-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}
.stock-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.stock-card {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}
.stock-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}
.stock-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
}
.stock-amount {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    margin-bottom: 4px;
}
.stock-label {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
}
.stock-card.high {
    background: linear-gradient(135deg, #059669, #047857);
}
.stock-card.medium {
    background: linear-gradient(135deg, #d97706, #b45309);
}
.stock-card.low {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}
.alertas {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}
.alerta {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
    animation: slideIn 0.3s ease;
    max-width: 300px;
}
.alerta a {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}
.alerta a:hover {
    color: #93c5fd;
    text-decoration: underline;
}
@keyframes slideIn {
    from {transform: translateX(100%); opacity: 0;}
    to {transform: translateX(0); opacity: 1;}
}
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .header h1 {font-size: 2rem;}
    .stock-grid {grid-template-columns: 1fr 1fr; gap: 12px;}
    .transaction-section, .stock-section {padding: 20px;}
    .alertas {right: 10px; left: 10px;}
    .alerta {max-width: none;}
}
@media (max-width: 480px) {
    .stock-grid {grid-template-columns: 1fr;}
    body {padding: 10px;}
}