@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@300;400;500;600&family=Playfair+Display:wght@700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff; --surface: #f4f7f5; --border: #d0d8d3;
  --accent-l: #111111; --accent-e: #1e5631; --green: #1e5631;
  --green-mid: #2a7a45; --green-lit: #439a60; --green-bg: #eaf2ec;
  --text-1: #000000; --text-2: #333333; --text-3: #666666;
  --danger: #d32f2f; --danger-bg: #fdeaea; --radius: 8px; 
  --mono: 'IBM Plex Mono', monospace; --sans: 'IBM Plex Sans', sans-serif; --display: 'Playfair Display', serif;
}

body { background: var(--bg); color: var(--text-1); font-family: var(--sans); min-height: 100vh; padding-top: 80px; text-align: center; font-size: 1.05rem; }

nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: #ffffff; box-shadow: 0 2px 10px rgba(0,0,0,0.05); height: 70px; display: flex; align-items: center; justify-content: center; padding: 0 20px; }
.nav-left { position: absolute; left: 20px; display: flex; align-items: center; }
.menu-btn { background: none; border: none; cursor: pointer; color: var(--text-1); font-size: 1.8rem; padding: 5px; }
.nav-brand img { height: 45px; object-fit: contain; }

.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 150; opacity: 0; pointer-events: none; transition: 0.3s; }
.sidebar-overlay.active { opacity: 1; pointer-events: auto; }
.sidebar { position: fixed; top: 0; left: -280px; bottom: 0; width: 280px; background: #fff; z-index: 200; box-shadow: 4px 0 15px rgba(0,0,0,0.1); transition: 0.3s; display: flex; flex-direction: column; padding: 20px; text-align: left; overflow-y: auto; }
.sidebar.active { left: 0; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.sidebar-close { background: none; border: none; cursor: pointer; font-size: 1.5rem; }
.sidebar a { display: block; width: 100%; text-align: center; margin-bottom: 8px; padding: 14px 16px; font-size: 1.05rem; text-decoration: none; color: var(--text-2); font-weight: 600; border-radius: var(--radius); background: var(--surface); }
.sidebar a:hover { background: var(--border); }
.sidebar a.active { background: var(--text-1); color: #fff; }

.user-profile-sm { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.user-profile-sm img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--green); margin-bottom: 10px; }
.user-profile-sm h3 { font-family: var(--display); font-size: 1.2rem; margin: 0; }

.page-container { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 16px 80px; width: 100%; max-width: 680px; margin: 0 auto; text-align: center; }
.header-box { width: 100%; margin-bottom: 30px; text-align: center; }
.page-title { font-family: var(--mono); font-size: 0.95rem; font-weight: 600; text-transform: uppercase; color: var(--text-3); text-align: center; }
.page-title span { color: var(--text-1); font-weight: 700; }
.card { width: 100%; background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); margin-bottom: 24px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; }

.flota-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; width: 100%; justify-content: center; }
.v-card { position: relative; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-align: center; cursor: pointer; transition: 0.2s; display: flex; flex-direction: column; align-items: center; }
.v-card:hover { border-color: var(--green); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
.v-card .v-img { width: 100%; height: 220px; background: var(--surface); display: flex; align-items: center; justify-content: center; overflow: hidden; margin: 0 auto; }
.v-card .v-img img { width: 100%; height: 100%; object-fit: cover; }
.v-body { padding: 20px; width: 100%; }

.btn-delete-v { position: absolute; top: 10px; right: 10px; background: rgba(255, 255, 255, 0.95); border: 1px solid #ffcccc; color: var(--danger); width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: 0.2s; font-size: 1.1rem; z-index: 10; }
.btn-delete-v:hover { background: var(--danger); color: #fff; border-color: var(--danger); transform: scale(1.1); }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 300; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: #ffffff; border-radius: var(--radius); width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; padding: 30px 20px; position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; }
.m-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; width: 100%; align-items: center; text-align: center; }
.m-field label, .section-label { font-size: 0.9rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; font-family: var(--mono); text-align: center; margin-bottom: 4px; }

input, select, textarea { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; font-family: var(--sans); outline: none; width: 100%; max-width: 400px; text-align: center; font-size: 16px !important; font-weight: 500; }
input:focus, select:focus { border-color: var(--green); }
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; max-width: 400px; }
.m-grid .m-field input { max-width: 100%; }

.btn-save, .btn-calc, .btn-action { width: 100%; max-width: 400px; padding: 16px; border: none; border-radius: var(--radius); font-family: var(--sans); font-size: 1.05rem; font-weight: 600; cursor: pointer; text-transform: uppercase; transition: 0.2s; color: #fff; text-align: center; margin: 0 auto; }
.btn-save { background: var(--text-1); }
.btn-calc { background: var(--accent-l); }
.btn-action.success { background: var(--green); margin-top: 15px;}
.tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; width: 100%; max-width: 400px; overflow: hidden; }
.tab-btn { background: #fff; border: none; padding: 16px; font-size: 0.95rem; font-weight: 600; cursor: pointer; border-right: 1px solid var(--border); color: var(--text-3); text-align: center; }
.tab-btn:last-child { border-right: none; }
.tab-btn.active { color: var(--text-1); border-bottom: 4px solid var(--text-1); }

.v-selector { width: 100%; margin-bottom: 24px; text-align: center; }
.v-selector-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; justify-content: flex-start; align-items: center; width: 100%; max-width: 400px; margin: 0 auto; scrollbar-width: none; }
.v-chip { background: var(--surface); border: 2px solid transparent; border-radius: 30px; padding: 10px 20px; cursor: pointer; font-size: 0.95rem; font-weight: 600; transition: all 0.2s; white-space: nowrap; color: var(--text-2); }
.v-chip.active { background: var(--green-bg); border-color: var(--green); color: var(--green); transform: scale(1.05); box-shadow: 0 4px 10px rgba(30, 86, 49, 0.15); }

.img-upload-area { border: 2px dashed var(--border); padding: 20px; text-align: center; cursor: pointer; border-radius: var(--radius); width: 100%; max-width: 400px; margin: 0 auto; background: var(--surface); transition: 0.2s; }
.img-upload-area:hover { border-color: var(--green); background: #fff; }

/* --- RECIBO ELEGANTE DE LIQUIDACIÓN --- */
.receipt-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 25px; margin: 25px auto 0; box-shadow: 0 10px 30px rgba(0,0,0,0.08); text-align: left; display: none; width: 100%; max-width: 400px; position: relative; }
.receipt-header { border-bottom: 2px dashed var(--border); padding-bottom: 15px; margin-bottom: 15px; text-align: center; }
.receipt-header h3 { font-family: var(--display); color: var(--text-1); font-size: 1.5rem; margin: 0; }
.receipt-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 1.05rem; color: var(--text-2); font-family: var(--sans); align-items: center; }
.receipt-row span:last-child { font-weight: 600; font-family: var(--mono); color: var(--text-1); }
.receipt-total { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; padding-top: 15px; border-top: 2px dashed var(--border); font-size: 1.3rem; color: var(--green); font-weight: bold; }
.receipt-total span:last-child { font-family: var(--mono); font-size: 1.6rem; }

.error-msg { color: var(--danger); font-size: 0.85rem; display: none; text-align: center; margin-top: -10px; margin-bottom: 15px; }
.error-msg.visible { display: block; }

.success-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.95); z-index: 9999; display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.success-overlay h2 { font-family: var(--display); color: var(--green); margin-top: 20px; font-size: 2rem; }
.checkmark-circle { width: 100px; height: 100px; border-radius: 50%; border: 5px solid var(--green); display: flex; align-items: center; justify-content: center; }
.checkmark { width: 40px; height: 20px; border-bottom: 6px solid var(--green); border-right: 6px solid var(--green); transform: rotate(45deg); margin-bottom: 10px; animation: pop 0.5s ease-in-out; }
@keyframes pop { 0% { transform: scale(0) rotate(45deg); } 50% { transform: scale(1.2) rotate(45deg); } 100% { transform: scale(1) rotate(45deg); } }