:root {
    --primary: #1e88a8;
    --primary-light: #29a3c4;
    --primary-dark: #15657a;
    --secondary: #4db6ac;
    --gold: #4dd0e1;
    --gold-light: #80deea;
    --bg: #f0f8fa;
    --card-bg: #ffffff;
    --text: #263238;
    --text-muted: #78909c;
    --border: #cfd8dc;
    --danger: #e53935;
    --success: #43a047;
    --whatsapp: #25D366;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--secondary) 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
    border-bottom: 3px solid var(--gold);
}

.logo-container { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.logo-image {
    width: 80px; height: 80px; border-radius: 50%;
    border: 3px solid var(--gold); background: white; padding: 5px;
    object-fit: contain; box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.logo-title {
    font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700;
    letter-spacing: 2px; color: white; text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.logo-subtitle { font-size: 14px; font-weight: 300; letter-spacing: 1px; opacity: 0.95; }

.nav-tabs {
    display: flex; overflow-x: auto; background: white;
    border-bottom: 1px solid var(--border); position: sticky; top: 0;
    z-index: 100; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.nav-tab {
    flex: 1; min-width: 70px; padding: 12px 5px; border: none; background: none;
    cursor: pointer; display: flex; flex-direction: column; align-items: center;
    gap: 4px; font-size: 11px; color: var(--text-muted);
    border-bottom: 3px solid transparent; transition: all 0.3s ease;
}
.nav-tab.active {
    color: var(--primary); border-bottom-color: var(--gold); font-weight: 500;
    background: linear-gradient(to bottom, rgba(77, 208, 225, 0.1), transparent);
}
.tab-icon { font-size: 18px; }
.tab-badge {
    background: var(--gold); color: var(--primary-dark);
    border-radius: 10px; padding: 2px 6px; font-size: 10px; font-weight: bold;
}

.main-content { flex: 1; padding: 20px; padding-bottom: 40px; }
.view-section { display: none; animation: fadeIn 0.3s ease; }
.view-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.section-header h2 { font-family: 'Playfair Display', serif; color: var(--primary); font-size: 22px; }
.date-display, .week-display { font-size: 14px; color: var(--text-muted); text-transform: capitalize; }

.card {
    background: var(--card-bg); border-radius: 12px; padding: 20px;
    margin-bottom: 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid var(--border); border-top: 3px solid var(--gold);
}
.card h3 { color: var(--primary); margin-bottom: 15px; font-size: 18px; }

.form-row { display: flex; gap: 15px; margin-bottom: 15px; }
.form-group { flex: 1; display: flex; flex-direction: column; gap: 5px; margin-bottom: 15px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
    padding: 12px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 15px; font-family: inherit; transition: border-color 0.3s; background: white;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30, 136, 168, 0.1);
}

.btn {
    padding: 12px 20px; border: none; border-radius: 8px; font-size: 15px;
    font-weight: 500; cursor: pointer; transition: all 0.2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: white; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(30, 136, 168, 0.3); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-whatsapp { background: var(--whatsapp); color: white; }
.btn-copy { background: #6c757d; color: white; }
.btn-pdf { background: var(--gold); color: var(--primary-dark); font-weight: bold; }
.btn-secondary { background: #eceff1; color: var(--text); }
.btn:hover { opacity: 0.9; transform: translateY(-1px); }

.appointments-list { display: flex; flex-direction: column; gap: 15px; }
.appointment-item {
    background: white; border-radius: 12px; padding: 15px;
    border-left: 4px solid var(--gold); box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: transform 0.2s;
}
.appointment-item:hover { transform: translateX(5px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.appointment-item.past { opacity: 0.7; border-left-color: var(--text-muted); }

.appointment-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; flex-wrap: wrap; gap: 10px; }
.appointment-name { font-weight: bold; font-size: 16px; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.payment-badge { font-size: 11px; padding: 3px 8px; border-radius: 12px; font-weight: normal; }
.payment-paid { background: #c8e6c9; color: #2e7d32; }
.payment-pending { background: #fff9c4; color: #f9a825; }
.payment-partial { background: #ffcdd2; color: #c62828; }

.appointment-date { font-size: 13px; color: var(--text-muted); }
.appointment-location { font-size: 13px; color: var(--primary); font-weight: 500; margin-bottom: 5px; }
.appointment-details { font-size: 14px; color: var(--text); margin-bottom: 10px; line-height: 1.5; }
.appointment-price { font-size: 18px; font-weight: bold; color: var(--primary); margin-bottom: 10px; }
.appointment-notes {
    background: #e0f7fa; padding: 10px; border-radius: 8px;
    font-size: 13px; color: var(--text); margin-bottom: 10px; border-left: 3px solid var(--gold);
}
.appointment-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.appointment-actions .btn { padding: 8px 12px; font-size: 13px; flex: 1; min-width: 100px; }

.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat-card {
    background: white; padding: 20px; border-radius: 12px; text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05); border-top: 3px solid var(--gold);
}
.stat-icon { font-size: 24px; margin-bottom: 10px; }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.stat-value { font-size: 22px; font-weight: bold; color: var(--primary); font-family: 'Playfair Display', serif; }
.stat-subtitle { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

.monthly-details { display: flex; flex-direction: column; gap: 10px; }
.month-item { display: flex; justify-content: space-between; padding: 10px; background: #e0f7fa; border-radius: 8px; }
.month-name { font-weight: 500; text-transform: capitalize; }
.month-amount { color: var(--primary); font-weight: bold; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 48px; margin-bottom: 15px; opacity: 0.5; }
.info-text { font-size: 14px; color: var(--text-muted); margin-bottom: 15px; }

.modal {
    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; padding: 20px;
}
.modal.hidden { display: none; }
.modal-content {
    background: white; padding: 25px; border-radius: 12px;
    max-width: 400px; width: 100%; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.modal-content h3 { color: var(--primary); margin-bottom: 15px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }

.install-prompt {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: white; padding: 15px 20px; border-radius: 12px;
    display: flex; align-items: center; gap: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 999; max-width: 90%;
}
.install-prompt.hidden { display: none; }
.install-prompt p { font-size: 14px; margin: 0; }
.install-prompt .btn { padding: 8px 15px; font-size: 13px; }

.app-footer {
    text-align: center; padding: 30px 20px 20px; margin-top: 20px;
    border-top: 1px solid #e8e8e8; background-color: #fafafa;
}
.footer-logo { width: 70px; height: auto; margin-bottom: 10px; filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.1)); }
.footer-text { font-size: 12px; color: #888; line-height: 1.4; margin: 0; font-family: 'Roboto', sans-serif; }
.footer-text strong { color: var(--primary); font-family: 'Playfair Display', serif; font-size: 14px; letter-spacing: 0.5px; }

@media (max-width: 600px) {
    .form-row { flex-direction: column; gap: 0; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .logo-title { font-size: 22px; }
}