/* ===================================
   SR. M FINANZAS - STYLESHEET
   Negro (#1a1a1a) + Dorado (#D4AF37)
   ==================================== */

/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0d0d0d;
    color: #e5e5e5;
    padding-bottom: 80px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* HEADER */
.header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-bottom: 2px solid #D4AF37;
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-header {
    width: 50px;
    height: 50px;
}

.logo-header img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.header-text h1 {
    font-size: 24px;
    color: #D4AF37;
    margin-bottom: 0.2rem;
}

.header-text p {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

/* COTIZACIÓN */
.cotizacion-box {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.cotizacion-input {
    text-align: center;
}

.cotizacion-input label {
    font-size: 11px;
    color: #888;
    display: block;
    margin-bottom: 0.5rem;
}

.cotizacion-input input {
    width: 120px;
    padding: 0.8rem;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    border-radius: 6px;
    border: 2px solid #D4AF37;
    background: #1a1a1a;
    color: #D4AF37;
}

.cotizacion-input input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

/* TABS */
.tabs-container {
    display: flex;
    flex-direction: column;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    background: #1a1a1a;
    border-top: 1px solid #333;
    padding: 0.5rem;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.tab {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    border-top: 3px solid transparent;
    text-align: center;
}

.tab.active {
    color: #D4AF37;
    border-top-color: #D4AF37;
}

/* TAB CONTENT */
.tab-content {
    display: none;
}

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

/* CARDS */
.card {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 1rem;
    color: #D4AF37;
}

.card h3 {
    font-size: 14px;
    color: #888;
    margin-bottom: 0.75rem;
}

/* KPI GRID */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border: 1px solid #D4AF37;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
}

.kpi-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.kpi-value {
    font-size: 28px;
    font-weight: bold;
    color: #D4AF37;
}

.kpi-small {
    font-size: 12px;
    color: #666;
    margin-top: 0.5rem;
}

/* GRIDS */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-section {
    background: #2d2d2d;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 3px solid #D4AF37;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

/* INPUTS */
input, select {
    padding: 0.6rem;
    border: 1px solid #333;
    border-radius: 6px;
    font-size: 13px;
    width: 100%;
    background: #0d0d0d;
    color: #e5e5e5;
}

input:focus, select:focus {
    outline: none;
    border-color: #D4AF37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

/* BUTTONS */
.btn-primary {
    padding: 0.8rem 1.5rem;
    background: #D4AF37;
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #FFE55C;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.btn-secondary {
    padding: 0.6rem 1rem;
    background: transparent;
    color: #D4AF37;
    border: 1px solid #D4AF37;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-secondary:hover {
    background: rgba(212, 175, 55, 0.1);
}

/* CAPITAL TOTAL */
.capital-total {
    background: linear-gradient(135deg, #D4AF37 0%, #FFE55C 100%);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.capital-total .label {
    font-size: 13px;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.capital-total .saldo {
    font-size: 36px;
    font-weight: bold;
    color: #1a1a1a;
}

/* BILLETERAS */
.billetera-item {
    background: #2d2d2d;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #D4AF37;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.billetera-item .saldo {
    font-size: 16px;
    font-weight: bold;
    color: #D4AF37;
}

/* GASTOS */
.gasto-item {
    padding: 0.75rem;
    border-bottom: 1px solid #333;
}

.gasto-item strong {
    color: #D4AF37;
}

.gasto-monto {
    color: #ff6b6b;
    font-weight: bold;
}

.gasto-fecha {
    font-size: 11px;
    color: #666;
    margin-top: 0.25rem;
}

/* MODALES */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1a1a1a;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    border: 1px solid #D4AF37;
}

.modal-content h2 {
    margin-bottom: 1rem;
    color: #D4AF37;
}

.modal-content input, .modal-content select {
    margin-bottom: 0.75rem;
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.modal-buttons button {
    flex: 1;
}

/* GRÁFICOS */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 2rem;
}

/* CATEGORÍAS */
.categoria-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.categoria-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(212, 175, 55, 0.2);
    color: #D4AF37;
    border-radius: 20px;
    font-size: 11px;
    cursor: pointer;
    border: 1px solid #D4AF37;
}

.categoria-badge.active {
    background: #D4AF37;
    color: #1a1a1a;
}

/* CHAT */
.chat-box {
    background: #2d2d2d;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 1rem;
    height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.chat-message {
    margin: 0.75rem 0;
    padding: 0.75rem;
    border-radius: 6px;
}

.chat-message.user {
    background: rgba(212, 175, 55, 0.1);
    color: #D4AF37;
}

.chat-message.assistant {
    background: rgba(100, 100, 100, 0.2);
    color: #e5e5e5;
}

#chatInput {
    height: 40px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .grid-2, .kpi-grid {
        grid-template-columns: 1fr !important;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .container {
        padding: 1rem;
    }
}
