:root {
    --bg-dark: #0f111a;
    --bg-darker: #08090e;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-light: rgba(255, 255, 255, 0.1);
    --text-main: #f8f9fa;
    --text-muted: #a0aabf;
    --accent: #d4af37; /* Gold */
    --accent-hover: #f1cf59;
    --crimson: #e63946;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Outfit', sans-serif; background-color: var(--bg-dark);
    background-image: radial-gradient(circle at top center, rgba(212, 175, 55, 0.08), transparent 40%), radial-gradient(circle at bottom center, rgba(230, 57, 70, 0.05), transparent 40%);
    color: var(--text-main); min-height: 100vh; display: flex; justify-content: center; padding: 3rem 2rem;
}
.app-container { width: 100%; max-width: 1100px; display: flex; flex-direction: column; gap: 3rem; }
.app-header { text-align: center; animation: fadeInDown 0.8s ease; }
.logo { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 1rem; }
.logo h1 { font-size: 3.5rem; font-weight: 800; letter-spacing: -1.5px; }
.logo span { color: var(--accent); }
.app-header p { color: var(--text-muted); font-size: 1.2rem; max-width: 600px; margin: 0 auto; font-weight: 300; }

/* Config Section */
.config-section { display: flex; justify-content: center; margin-bottom: 0rem; animation: fadeInDown 0.8s ease;}
.ruc-input-container { background: var(--bg-card); border: 1px solid var(--accent); padding: 1.5rem 2.5rem; border-radius: 20px; text-align: center; box-shadow: 0 5px 20px rgba(212, 175, 55, 0.1); backdrop-filter: blur(10px);}
.ruc-input-container label { display: block; margin-bottom: 0.8rem; font-weight: 600; color: var(--accent); font-size: 1.1rem;}
.ruc-input-container input { background: rgba(0,0,0,0.3); border: 1px solid var(--border-light); color: var(--text-main); font-size: 1.3rem; padding: 0.8rem 1.5rem; border-radius: 10px; width: 260px; text-align: center; outline: none; transition: all 0.3s; letter-spacing: 2px; font-weight: 600;}
.ruc-input-container input:focus { border-color: var(--accent); box-shadow: 0 0 15px rgba(212, 175, 55, 0.3); }
.ruc-input-container .helper { font-size: 0.85rem; color: var(--text-muted); margin-top: 1rem; max-width: 350px; line-height: 1.4;}

/* Drop Zone */
.upload-section { width: 100%; }
.drop-zone { background: var(--bg-card); border: 2px dashed var(--border-light); border-radius: 24px; padding: 5rem 2rem; text-align: center; cursor: pointer; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); backdrop-filter: blur(15px); box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.drop-zone:hover:not(.disabled), .drop-zone.dragover:not(.disabled) { border-color: var(--accent); background: rgba(212, 175, 55, 0.08); transform: translateY(-8px); box-shadow: 0 15px 50px rgba(212, 175, 55, 0.15); }
.drop-zone.disabled { opacity: 0.5; cursor: not-allowed; border-style: dotted; }
.drop-zone.disabled * { filter: grayscale(1); }
.drop-icon { font-size: 4.5rem; display: block; margin-bottom: 1.5rem; transition: transform 0.3s ease; }
.drop-zone:hover:not(.disabled) .drop-icon { transform: scale(1.1); }
.drop-zone h2 { font-weight: 600; font-size: 1.6rem; margin-bottom: 0.5rem; }
.drop-zone p { color: var(--text-muted); font-size: 1.1rem; }

/* Dashboard UI */
.hidden { display: none !important; }
.dashboard-section { animation: fadeInUp 0.6s ease; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-light); }
.dashboard-header h2 { font-size: 1.8rem; font-weight: 600; }
.badge { background: rgba(212, 175, 55, 0.15); color: var(--accent); padding: 0.6rem 1.2rem; border-radius: 30px; font-weight: 600; font-size: 0.95rem; border: 1px solid rgba(212, 175, 55, 0.3); }

.block-title { font-size: 1.3rem; font-weight: 400; color: var(--text-muted); margin-bottom: 1.5rem; padding-bottom: 0.5rem; border-bottom: 1px dashed var(--border-light); letter-spacing: 1px;}
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.data-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 20px; padding: 2rem; backdrop-filter: blur(10px); transition: transform 0.3s ease, border-color 0.3s ease; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.data-card::before { content: ''; position: absolute; top: 0; left: 0; width: 6px; height: 100%; background: var(--border-light); border-radius: 2px; }
.data-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,0.2); }
.card-label { display: block; color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 1rem; }
.data-card h3 { font-size: 2.5rem; font-weight: 800; margin-bottom: auto; color: var(--text-main); }
.data-card p { font-size: 0.85rem; color: var(--text-muted); margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border-light); }
.alert-card::before { background: var(--crimson); }
.highlight::before { background: var(--accent); }

.action-bar { display: flex; justify-content: center; margin-top: 3rem; }
.reset-btn { background: var(--accent); color: var(--bg-darker); border: none; padding: 1rem 3rem; font-size: 1.1rem; font-weight: 600; border-radius: 40px; cursor: pointer; transition: all 0.3s ease; }
.reset-btn:hover { background: var(--accent-hover); box-shadow: 0 8px 30px rgba(212, 175, 55, 0.4); transform: scale(1.05); }

@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.5; } }

/* Detailed breakdown styles */
.breakdown-container {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}
.breakdown-container h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.breakdown-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.breakdown-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.breakdown-item .rate-lbl {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
}
.breakdown-item .rate-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
}
.breakdown-item .rate-iva {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Grid configuration inputs */
.config-grid { display: flex; gap: 25px; align-items: center; justify-content: center; flex-wrap: wrap; }
.config-item { display: flex; flex-direction: column; align-items: center; }
.config-item label { margin-bottom: 0.6rem; font-weight: 600; color: var(--accent); font-size: 0.95rem;}
.config-item select {
    background: rgba(0,0,0,0.3); border: 1px solid var(--border-light); color: var(--text-main);
    font-size: 1.15rem; padding: 0.8rem 1.2rem; border-radius: 10px; width: 160px; text-align-last: center;
    outline: none; transition: all 0.3s; font-weight: 600; cursor: pointer;
}
.config-item select:focus { border-color: var(--accent); box-shadow: 0 0 10px rgba(212, 175, 55, 0.3); }

/* Buttons styling updates */
.save-btn:hover { background: var(--accent-hover); box-shadow: 0 8px 30px rgba(212, 175, 55, 0.4); transform: scale(1.05); }
.reset-btn:hover { background: rgba(255, 255, 255, 0.1); transform: scale(1.05); }

/* History Section */
.history-section { margin-top: 4rem; animation: fadeInUp 0.8s ease; }
.history-header { margin-bottom: 1.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border-light); }
.history-container { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 20px; overflow-x: auto; backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.history-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.95rem; min-width: 800px; }
.history-table th, .history-table td { padding: 1.2rem 1.5rem; border-bottom: 1px solid var(--border-light); }
.history-table th { color: var(--accent); font-weight: 600; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.5px; }
.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover td { background: rgba(255,255,255,0.01); }
.action-link { cursor: pointer; font-weight: 600; transition: all 0.3s; margin-right: 15px; background: none; border: none; font-family: inherit; font-size: 0.9rem; }
.action-link.load { color: var(--accent); }
.action-link.load:hover { color: var(--accent-hover); text-shadow: 0 0 5px rgba(212,175,55,0.3); }
.action-link.delete { color: var(--crimson); }
.action-link.delete:hover { color: #ff5e6c; text-shadow: 0 0 5px rgba(230,57,70,0.3); }

/* Casilleros form SRI style */
.casillero-tag {
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--accent);
    color: #ffb74d;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 1.15rem;
    font-weight: 800;
    margin-top: 0.8rem;
    display: inline-block;
    letter-spacing: 0.5px;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
    align-self: flex-start;
}
.alert-card .casillero-tag {
    background: rgba(239, 83, 80, 0.15);
    border: 1px solid var(--crimson);
    color: #ef5350;
    box-shadow: 0 0 10px rgba(239, 83, 80, 0.1);
}
