/* Dark mode removido */

:root {
    --primary: #007AFF; 
    --primary-dark: #0056b3;
    --primary-gradient: linear-gradient(135deg, #007AFF 0%, #0056b3 100%);
    --success: #34C759;
    --danger: #FF3B30;
    
    --bg-mesh-1: #ffffff;
    --bg-mesh-2: #f4f6f9;
    --bg-mesh-3: #e8ecf1;
    --bg-mesh-4: #fdfdfd;
    
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 1);
    --glass-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    --glass-blur: blur(30px) saturate(180%);
    
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --dark: #111827; 
    --input-bg: rgba(0, 0, 0, 0.04);
    --input-border: rgba(0, 0, 0, 0.08);
    
    --font-family: 'Outfit', sans-serif;
    --radius-lg: 24px;
    --radius-md: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font-family); -webkit-tap-highlight-color: transparent; }

body {
    background: linear-gradient(45deg, var(--bg-mesh-1), var(--bg-mesh-2), var(--bg-mesh-3), var(--bg-mesh-4));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-main); display: flex; justify-content: center; min-height: 100vh;
}

@keyframes gradientBG { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

.app-container {
    width: 100%; max-width: 428px; position: relative; box-shadow: 0 0 50px rgba(0,0,0,0.1);
    display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: transparent;
}

.glass-panel {
    background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow);
}

header {
    padding: 20px 24px; z-index: 50; position: relative;
    border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg);
    display: flex; justify-content: space-between; align-items: center;
}

.app-logo { height: 90px; object-fit: contain; mix-blend-mode: darken; margin-left: 4px; }

.logout-btn {
    position: relative; right: 0; background: rgba(239, 68, 68, 0.1); color: var(--danger);
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; border: none; cursor: pointer; transition: 0.2s;
}
.logout-btn i { font-size: 22px; }
.logout-btn:active { transform: scale(0.9); }

.view { display: none; flex: 1; overflow-y: auto; padding-bottom: 110px; }
.view.active { display: flex; flex-direction: column; animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.login-card { padding: 40px 24px; text-align: center; margin: auto 20px; border-radius: var(--radius-lg); }
.login-card img { height: 60px; margin-bottom: 24px; border-radius: 16px; box-shadow: 0 8px 20px rgba(0,0,0,0.1); background: white; padding: 8px;}
.divider { margin: 24px 0; position: relative; }
.divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; border-top: 1px solid var(--input-border); }
.divider span { position: relative; padding: 0 10px; font-size: 13px; color: var(--text-muted); background: var(--glass-bg); border-radius: 10px; font-weight: 500; }
.register-link { margin-top: 24px; font-size: 14px; color: var(--text-muted); }
.register-link a { color: var(--primary); text-decoration: none; font-weight: 700; }

.setup-card, .add-item-card, .trip-info-header, .content-section, .list-item, .history-item { border-radius: var(--radius-lg); margin-bottom: 16px; }
h2, h3 { color: var(--dark); font-weight: 700; letter-spacing: -0.5px; }

.form-group { display: flex; flex-direction: column; margin-bottom: 20px; min-width: 0; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.form-group input, .form-group select {
    padding: 14px 16px; border: 1.5px solid var(--input-border); border-radius: var(--radius-md); font-size: 16px; outline: none; transition: all 0.25s ease;
    background: var(--input-bg); color: var(--text-main); font-weight: 500;
}
.form-group input:focus, .form-group select:focus { border-color: var(--primary); background: var(--glass-bg); box-shadow: 0 4px 12px rgba(0, 122, 255, 0.1); }
.form-group input::placeholder { color: #a1a1aa; }

.qty-control { display: flex; align-items: stretch; border: 1.5px solid var(--input-border); border-radius: var(--radius-md); background: var(--input-bg); overflow: hidden; height: 50px;}
.qty-btn { width: 44px; background: rgba(0,0,0,0.03); border: none; font-size: 20px; font-weight: 500; color: var(--primary); cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center;}
.qty-btn:active { background: rgba(0,0,0,0.1); }
.qty-control input { flex: 1; text-align: center; border: none; background: transparent; padding: 0; outline: none; font-size: 16px; font-weight: 600; color: var(--text-main); border-radius: 0; min-width: 0;}
.qty-control input::-webkit-outer-spin-button, .qty-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-control input[type=number] { -moz-appearance: textfield; }

.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon input { width: 100%; padding-right: 50px; }
.btn-icon {
    position: absolute; right: 8px; background: transparent; border: none; color: var(--primary); font-size: 22px; cursor: pointer; padding: 8px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background 0.2s;
}
.btn-icon:hover { background: rgba(0, 122, 255, 0.1); }

.flex-2 { flex: 2; } .flex-1 { flex: 1; }
.input-row { display: flex; gap: 10px; align-items: stretch; width: 100%; }

.btn {
    padding: 14px 20px; border-radius: var(--radius-md); font-size: 15px; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--primary-gradient); color: white; box-shadow: 0 8px 20px rgba(0, 122, 255, 0.3); }
.btn-primary:hover { box-shadow: 0 10px 25px rgba(0, 122, 255, 0.4); transform: translateY(-1px); }
.btn-success { background: linear-gradient(135deg, #34C759 0%, #28a745 100%); color: white; box-shadow: 0 8px 20px rgba(52, 199, 89, 0.3); }
.btn-success:hover { box-shadow: 0 10px 25px rgba(52, 199, 89, 0.4); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1.5px solid var(--text-muted); color: var(--text-main); }
.btn-block { width: 100%; margin-top: 12px; }
.btn-delete { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: none; width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; transition: 0.2s; margin-left: 8px; }
.btn-delete:active { transform: scale(0.9); background: rgba(239, 68, 68, 0.2); }

.trip-info-header { padding: 16px; display: flex; justify-content: space-between; align-items: center; margin: 12px 16px; }
.add-item-card { padding: 16px; margin: 0 16px 16px; }

.shopping-list { list-style: none; padding: 0 20px; }
.list-item { padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; border-radius: 12px; }
.item-title { font-size: 15px; font-weight: 600; color: var(--dark); margin-bottom: 2px; }
.item-desc { font-size: 13px; color: var(--text-muted); font-weight: 500; line-height: 1.2; }
.item-price-total { font-size: 15px; font-weight: 700; color: var(--primary); }
.item-right-section { display: flex; align-items: center; }
.actions { padding: 24px 20px; position: sticky; bottom: 0; z-index: 10; }

.content-section { padding: 24px 20px; margin: 16px 20px; }
.subtitle { font-size: 15px; color: var(--text-muted); margin-bottom: 24px; font-weight: 500; line-height: 1.4; }
.table-container { width: 100%; overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--input-border); }
.excel-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.excel-table th { background: rgba(0,0,0,0.02); padding: 16px; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--input-border); text-transform: uppercase; font-size: 12px; }
.excel-table td { padding: 16px; border-bottom: 1px solid var(--input-border); color: var(--dark); font-weight: 500; }
.excel-table tr:last-child td { border-bottom: none; }
.change-up { color: var(--danger); font-weight: 700; background: rgba(239, 68, 68, 0.1); padding: 4px 8px; border-radius: 6px; }
.change-down { color: var(--success); font-weight: 700; background: rgba(52, 199, 89, 0.1); padding: 4px 8px; border-radius: 6px; }
.mt-4 { margin-top: 24px; }
.chart-container { width: 100%; aspect-ratio: 4/3; padding: 20px; border-radius: var(--radius-md); border: 1px solid var(--input-border); }

.history-list { list-style: none; }
.history-item { padding: 20px; transition: transform 0.2s ease; margin-bottom: 16px; position: relative; }
.history-item:active { transform: scale(0.98); }
.history-item::after { content: '\203A'; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 24px; color: var(--primary); }
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-right: 20px; }
.history-market { font-weight: 700; font-size: 18px; color: var(--dark); }
.history-total { font-weight: 700; font-size: 18px; color: var(--primary); }
.history-meta { font-size: 14px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; font-weight: 500; }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; color: var(--text-muted); animation: fadeIn 0.4s ease; }
.empty-state i { font-size: 64px; margin-bottom: 16px; opacity: 0.5; color: var(--primary); }
.empty-state h3 { font-size: 20px; color: var(--dark); margin-bottom: 8px; }

.bottom-nav {
    position: absolute; bottom: 0; left: 0; width: 100%; display: flex; justify-content: space-around; padding: 16px 0 28px;
    z-index: 100; border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg); background: var(--glass-bg); border-top: 1px solid var(--glass-border);
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--text-muted); font-size: 12px; font-weight: 600; transition: all 0.2s ease; }
.nav-item i { font-size: 26px; transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.nav-item.active { color: var(--primary); }
.nav-item.active i { font-weight: bold; transform: translateY(-3px); }

.toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 12px; width: 90%; max-width: 380px; pointer-events: none; }
.toast { padding: 16px 20px; border-radius: var(--radius-md); font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 12px; color: var(--text-main); }
.toast.toast-success i { color: var(--success); }
.toast.toast-error i { color: var(--danger); }

.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 9999; display: flex; justify-content: center; align-items: center; }
.modal-box { width: 90%; max-width: 340px; padding: 32px 24px; text-align: center; }
.modal-icon { font-size: 48px; color: var(--primary); margin-bottom: 16px; }
.modal-box h3 { font-size: 20px; margin-bottom: 12px; }
.modal-box p { font-size: 15px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.5; }
.modal-actions { display: flex; gap: 12px; }
.modal-actions .btn { flex: 1; padding: 14px; }

.receipt-box { width: 90%; max-width: 380px; padding: 24px; border-radius: var(--radius-lg); max-height: 85vh; overflow-y: auto; }
.receipt-header { text-align: center; border-bottom: 2px dashed var(--input-border); padding-bottom: 16px; margin-bottom: 16px; }
.receipt-header h3 { font-size: 18px; font-weight: 700; letter-spacing: 1px; margin-bottom: 4px; color: var(--dark); text-transform: uppercase;}
.receipt-header p { font-size: 13px; color: var(--text-muted); white-space: pre-line; }
.receipt-table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; }
.receipt-table th { border-bottom: 1px solid var(--input-border); padding: 8px 0; color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 11px; }
.receipt-table td { padding: 12px 0; border-bottom: 1px solid var(--input-border); color: var(--dark); font-weight: 500; }
.receipt-table tr:last-child td { border-bottom: none; }
.receipt-footer { display: flex; justify-content: space-between; align-items: center; border-top: 2px dashed var(--input-border); padding-top: 16px; margin-top: 16px; font-size: 20px; font-weight: 700; color: var(--primary-dark); }
