/* --- ESTILOS GENERALES (ERP VILLAMIR) --- */
:root { --primary: #2b3552; --secondary: #edf2f7; --accent: #5a67d8; --text-dark: #2d3748; --text-light: #718096; }
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', sans-serif; }
body { background-color: #f3f4f6; color: var(--text-dark); height: 100vh; overflow: hidden; }

/* LAYOUT */
.container { display: flex; height: 100%; }
.sidebar { width: 260px; background-color: var(--primary); color: #fff; display: flex; flex-direction: column; padding: 20px 0; }
.main-content { flex: 1; padding: 30px; overflow-y: auto; }
.hidden { display: none !important; }

/* SIDEBAR & MENU */
.brand h2 { padding: 0 20px 20px; font-size: 18px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.menu { list-style: none; margin-top: 20px; flex-grow: 1; }
.menu li { margin-bottom: 5px; }
.menu li a { display: flex; align-items: center; gap: 15px; padding: 12px 25px; color: #a0aec0; text-decoration: none; font-size: 14px; transition: 0.3s; }
.menu li a:hover, .menu li a.active { background-color: rgba(255,255,255,0.1); color: #fff; border-left: 4px solid var(--accent); }
.user-profile { padding: 20px; background-color: rgba(0,0,0,0.2); display: flex; align-items: center; gap: 10px; margin-top: auto; }
.avatar { width: 35px; height: 35px; background: #333; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; }
.info { display: flex; flex-direction: column; font-size: 12px; }

/* UI COMPONENTS */
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); margin-bottom: 20px; }
.btn-primary { background-color: var(--primary); color: #fff; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: bold; }
.btn-secondary { background-color: var(--secondary); color: var(--text-dark); border: none; padding: 10px 20px; border-radius: 6px; margin-right: 10px; cursor: pointer; }
.btn-small { background: var(--secondary); border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.btn-icon { background: var(--secondary); border: none; width: 30px; height: 30px; border-radius: 4px; cursor: pointer; color: var(--text-dark); margin-right: 5px; }
.btn-danger { background-color: #fff5f5; border: 1px solid #feb2b2; color: #c53030; }
.search-bar { background: #fff; border: 1px solid #e2e8f0; padding: 10px; border-radius: 6px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; color: #888; }
.search-bar input { border: none; background: transparent; outline: none; width: 100%; }

/* TABLAS & FORMULARIOS */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--text-light); padding: 15px; border-bottom: 1px solid #eee; }
.table td { padding: 15px; border-bottom: 1px solid #eee; }
.table-actions { display: flex; gap: 8px; align-items: center; }
.role-select { padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 5px; background: #f7fafc; font-size: 12px; }
.row-cancelado { background: #edf2f7; color: #4a5568; }
.grid-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 15px; }
.input-group { display: flex; flex-direction: column; gap: 5px; }
.input-group.full-width { grid-column: span 2; }
.input-group label { font-size: 12px; font-weight: bold; color: var(--text-light); }
.input-group input, .input-group select, .input-group textarea { padding: 10px; border: 1px solid #e2e8f0; border-radius: 5px; background: #f7fafc; }

/* BADGES */
.badge { padding: 5px 10px; border-radius: 15px; font-size: 11px; font-weight: bold; display: inline-block; }
.badge.blue { background-color: #ebf8ff; color: #4299e1; }
.green-soft { background-color: #def7ec; color: #03543f; }
.yellow-soft { background-color: #fef3c7; color: #92400e; }
.red-soft { background-color: #fde8e8; color: #9b1c1c; }
.badge.cancelado { background: #e2e8f0; color: #4a5568; }

/* DASHBOARD & EXTRAS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 20px; }
.stat-card { background: white; padding: 20px; border-radius: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); display: flex; align-items: center; gap: 15px; }
.stat-card .icon { width: 50px; height: 50px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.stat-card.blue .icon { background: #ebf8ff; color: #3b82f6; }
.stat-card.green .icon { background: #dcfce7; color: #10b981; }
.stat-card.orange .icon { background: #ffedd5; color: #f59e0b; }
.stat-card.red .icon { background: #fee2e2; color: #ef4444; }
.totals-card { background: var(--primary); color: white; padding: 20px; border-radius: 8px; }
.totals-card .row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.totals-card .total { font-size: 18px; font-weight: bold; margin-top: 10px; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 10px; }
.add-expense-box { background-color: #f8fafc; padding: 10px; border-radius: 6px; border: 1px solid #e2e8f0; margin-bottom: 10px; }
.table-mini { width: 100%; border-collapse: collapse; font-size: 12px; }
.table-mini th { background-color: #edf2f7; padding: 8px; text-align: left; }
.table-mini td { padding: 8px; border-bottom: 1px solid #eee; }
.btn-delete-mini { background: none; border: none; color: #fc8181; cursor: pointer; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 10px; margin-top: 10px; }
.thumb-box { width: 60px; height: 60px; border-radius: 5px; overflow: hidden; border: 2px solid #e2e8f0; }
.thumb-box img { width: 100%; height: 100%; object-fit: cover; }
.login-body { display: flex; justify-content: center; align-items: center; height: 100vh; background-color: #1a233a; }
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-box { background: white; padding: 40px; border-radius: 10px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background: white; padding: 25px; border-radius: 8px; width: 90%; max-width: 600px; max-height: 80vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.btn-close { background: none; border: none; font-size: 20px; cursor: pointer; }
.row-selectable:hover { background-color: #ebf8ff; cursor: pointer; }
.section-header { display: flex; justify-content: space-between; margin-bottom: 15px; }
.profile-circle { width: 100px; height: 100px; background-color: #718096; border-radius: 50%; border: 3px solid #e2e8f0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tabs { display: flex; gap: 10px; }
.btn-tab { background: none; border: none; font-weight: bold; color: #a0aec0; cursor: pointer; padding: 8px 15px; border-radius: 5px; transition: 0.3s; }
.btn-tab:hover { background-color: #e2e8f0; }
.btn-tab.active { background-color: #2b3552; color: #fff; }
.profile-section { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.expenses-list { max-height: 150px; overflow-y: auto; border: 1px solid #e2e8f0; border-radius: 6px; }
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; }
.action-btn { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 20px; cursor: pointer; transition: 0.3s; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.action-btn:hover { background: #fff; border-color: #cbd5e1; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.action-btn span { font-weight: 600; color: #475569; font-size: 13px; }
.icon-box { width: 45px; height: 45px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; color: white; }
.blue-bg { background: #3b82f6; }
.green-bg { background: #10b981; }
.purple-bg { background: #8b5cf6; }
.orange-bg { background: #f97316; }
.status-item { display: flex; align-items: center; gap: 15px; padding: 10px; background: #f8fafc; border-radius: 8px; }
.doc-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.doc-card { background: #f7fafc; border: 1px solid #e2e8f0; padding: 10px; border-radius: 6px; min-width: 170px; }
.doc-card.empty { background: #fff; color: #999; font-size: 12px; }
.doc-card .doc-name { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.doc-card .doc-actions { display: flex; gap: 10px; font-size: 12px; }
.doc-card .doc-actions a { color: #2b3552; text-decoration: underline; }
.doc-chip { display: inline-block; padding: 6px 8px; background: #edf2f7; border-radius: 5px; font-size: 11px; margin-right: 6px; }
