:root {
    --primary-color: #004da6;
    --primary-light: #337acc;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #e0e6ed;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --nav-height: 65px;
    --header-height: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Inter', sans-serif; background-color: var(--bg-color); color: var(--text-main); overflow-x: hidden; height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3 { font-weight: 700; }
p { line-height: 1.5; }

/* Header */
.app-header { height: var(--header-height); background-color: var(--primary-color); color: white; position: fixed; top: 0; left: 0; width: 100%; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.header-content { display: flex; justify-content: space-between; align-items: center; height: 100%; padding: 0 20px; }
.header-brand { display: flex; align-items: center; }
#brand-logo { max-height: 35px; margin-right: 10px; background: white; padding: 2px; border-radius: 4px; }
#brand-icon { font-size: 1.5rem; margin-right: 10px; }
.header-content h1 { font-size: 1.25rem; letter-spacing: 0.5px; }

.btn-icon { background: rgba(255,255,255,0.2); border: none; color: white; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; display: flex; justify-content: center; align-items: center; font-size: 1.1rem; transition: background 0.3s; }
.btn-icon:hover { background: rgba(255,255,255,0.3); }

/* Main Content */
.app-content { margin-top: var(--header-height); margin-bottom: var(--nav-height); flex: 1; overflow-y: auto; padding: 20px; position: relative; }
.view { display: none; animation: fadeIn 0.3s ease-in-out; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Bottom Nav */
.bottom-nav { height: var(--nav-height); background-color: var(--card-bg); position: fixed; bottom: 0; left: 0; width: 100%; display: flex; justify-content: space-around; align-items: center; box-shadow: 0 -2px 15px rgba(0,0,0,0.05); z-index: 100; }
.nav-item { background: none; border: none; display: flex; flex-direction: column; align-items: center; color: var(--text-muted); font-size: 0.75rem; cursor: pointer; transition: all 0.3s ease; width: 25%; padding: 10px 0; }
.nav-item i { font-size: 1.3rem; margin-bottom: 5px; transition: transform 0.2s; }
.nav-item.active { color: var(--primary-color); }
.nav-item.active i { transform: translateY(-2px); }

/* Cards & Forms */
.dash-card { background: var(--card-bg); border-radius: 12px; padding: 20px; margin-bottom: 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.03); border: 1px solid var(--border-color); }
.dash-stats { display: flex; gap: 15px; margin-top: 15px; }
.stat-box { flex: 1; background: var(--bg-color); padding: 15px; border-radius: 8px; text-align: center; }
.stat-box h3 { font-size: 1.8rem; color: var(--primary-color); margin-bottom: 5px; }
.stat-box p { font-size: 0.8rem; color: var(--text-muted); }

/* Login */
.login-container { background: var(--card-bg); border-radius: 12px; padding: 40px 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid var(--border-color); text-align: center; max-width: 400px; margin: 20px auto; }

.form-group { margin-bottom: 15px; text-align: left;}
.form-group label { display: block; margin-bottom: 5px; font-size: 0.9rem; color: var(--text-muted); }
.form-control { width: 100%; padding: 12px 15px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 1rem; font-family: inherit; transition: border-color 0.3s; }
.form-control:focus { outline: none; border-color: var(--primary-color); }
.btn-primary { width: 100%; padding: 14px; background: var(--primary-color); color: white; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; box-shadow: 0 4px 10px rgba(0, 77, 166, 0.2); transition: transform 0.1s, background 0.3s; }
.btn-primary:active { transform: scale(0.98); }

.job-card { background: var(--card-bg); border-radius: 10px; padding: 15px; margin-bottom: 15px; box-shadow: 0 2px 5px rgba(0,0,0,0.02); border-left: 4px solid var(--primary-color); }
.job-card.status-pending { border-left-color: var(--warning); }
.job-card.status-completed { border-left-color: var(--success); }
.job-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.badge { padding: 4px 8px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-pending { background: #fef5e7; color: var(--warning); }
.badge-completed { background: #eafaf1; color: var(--success); }

.client-card { background: var(--card-bg); border-radius: 10px; padding: 15px; margin-bottom: 15px; display: flex; align-items: center; gap: 15px; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.client-avatar { width: 45px; height: 45px; border-radius: 50%; background: var(--primary-light); color: white; display: flex; justify-content: center; align-items: center; font-size: 1.2rem; font-weight: bold; }
.client-info h4 { margin-bottom: 3px; }
.client-info p { font-size: 0.85rem; color: var(--text-muted); }

/* Financial & Yape & Proforma */
.job-finance { display: flex; justify-content: space-between; background: #f8f9fa; padding: 8px 10px; border-radius: 6px; margin: 10px 0; font-size: 0.85rem; border: 1px solid var(--border-color); }
.job-finance div { display: flex; flex-direction: column; }
.finance-label { color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; }
.finance-value { font-weight: 700; color: var(--text-main); }
.finance-value.balance { color: var(--danger); }

.btn-yape, .btn-whatsapp, .btn-secondary { display: inline-block; width: 100%; padding: 10px; color: white; text-align: center; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: 0.9rem; margin-top: 5px; transition: background 0.3s; cursor: pointer; border: none; font-family: inherit; }
.btn-yape { background-color: #742284; }
.btn-yape:hover { background-color: #5c1b69; }
.btn-whatsapp { background-color: #25D366; }
.btn-whatsapp:hover { background-color: #1ebe5d; }
.btn-secondary { background-color: #6c757d; }
.btn-secondary:hover { background-color: #5a6268; }

.form-row { display: flex; gap: 15px; }
.form-row .form-group { flex: 1; }

/* Proforma Template Hidden Container */
.proforma-container { width: 400px; padding: 20px; background: white; color: black; font-family: 'Inter', sans-serif; box-sizing: border-box; }
.proforma-header { text-align: center; margin-bottom: 15px; border-bottom: 2px solid var(--border-color); padding-bottom: 15px; }
.proforma-body { font-size: 14px; margin-bottom: 20px; }
.proforma-item { display: flex; justify-content: space-between; border-bottom: 1px dashed #ccc; padding: 8px 0; }
.proforma-item strong { min-width: 120px; }
.proforma-footer { text-align: center; border-top: 2px solid var(--border-color); padding-top: 15px; }
