
.app-select {
    width: 100%;
    padding: 14px 40px 14px 14px; /* espaço para seta */
    font-size: 16px;
    border-radius: 14px;
    border: 1px solid #ddd;
    background: #fff;
    appearance: none;
    min-height: 56px;
    line-height: 1.4;
    display: block;
}

.field-group {
    position: absolute;
}
.field-group::after {
    content: "▾";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 14px;
    color: #666;
}
.app-select option {
    font-size: 16px;
}


.safe-top {
    height: env(safe-area-inset-top);
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.05),
        rgba(0,0,0,0)
    );
}



/* =====================================================
   RESET SEGURO
===================================================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f6f7f8;
}

/* =====================================================
   CONTAINER GERAL
===================================================== */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
}

/* =====================================================
   CARD DE TELA / SEÇÕES
===================================================== */
.app-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,.08);
}

.app-card h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.app-card p {
    margin: 0 0 16px;
    font-size: 14px;
    color: #666;
}

/* =====================================================
   CAMPOS PADRÃO
===================================================== */
.app-field {
    width: 100%;
    display: block;
    margin-bottom: 24px;
}

.app-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.app-input,
select.app-input {
    width: 100%;
    padding: 0px;
      min-height: 56px;
    border-radius: 12px;
    font-size: 14px;
    background: #fff;
}

/* =====================================================
   CARDS DE OPÇÃO (atividade / objetivo)
===================================================== */
.app-option-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    min-height: 56px;
    width: 100%;
}

.app-option-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    min-height: 56px;
    transition: all 0.2s ease;
}

.app-option-card:hover {
    border-color: #22c55e;
}

/* Radio custom */
.app-option-card input {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #bbb;
    position: relative;
}

.app-option-card input:checked {
    border-color: #22c55e;
}

.app-option-card input:checked::after {
    content: "";
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
}

.app-option-card span {
    font-size: 14px;
    font-weight: 500;
}

/* =====================================================
   BOTÕES
===================================================== */
.app-btn,
.btn-primary {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    border: none;
    background: #22c55e;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

/* =====================================================
   AUTOCOMPLETE
===================================================== */
.autocomplete-list {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,.1);
    margin-top: 6px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 999;
}

.autocomplete-item {
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item strong {
    display: block;
    font-size: 14px;
}

.autocomplete-item small {
    font-size: 12px;
    color: #777;
}

/* =====================================================
   CALORIAS / DASHBOARD
===================================================== */
.cal-card {
    background: #fff;
    border-radius: 12px;
    text-align: center;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

.cal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.cal-big {
    font-size: 48px;
    color: #204891;
    font-weight: 800;
    
}

.cal-row {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 14px;
}

/* =====================================================
   BOTTOM NAV
===================================================== */
.cal-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background: #ffffff;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 9999;
}

.cal-bottom-nav .nav-item {
    flex: 1;
    text-align: center;
    align-items: center;

    text-decoration: none;
    color: #888;
    font-size: 12px;
}



.cal-bottom-nav .nav-item span {
    display: block;

    font-size: 22px;
    margin-bottom: 4px;
}

.cal-bottom-nav .nav-item.active {
    color: #22c55e;
    font-weight: 600;
}

/* Espaço para nav fixa */
.cal-dashboard {
    padding-bottom: 80px;
}







/* =====================================================
   MOBILE EXTRA
===================================================== */
@media (max-width: 480px) {
    .app-option-group {
        grid-template-columns: 1fr;
    }
}
.meal-group {
    margin-bottom: 20px;
}

.meal-group-title {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 15px;
    color: #444;
}
.meal-card {
     background: #fff;
    border-radius: 12px;
    text-align: center;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

.meal-card-header {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
}

.meal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.meal-item:last-child {
    border-bottom: none;
}

.meal-info {
    flex: 1;
    font-size: 14px;
}

.meal-calories {
    font-weight: 600;
    margin-right: 10px;
}

.meal-delete {
    font-size: 20px;
    color: #f44336;
    text-decoration: none;
    padding: 6px;
}

.add-meal-card .field-group {
    margin-bottom: 24px;
}



.gauge-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.gauge-value {
    position: relative;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 26px;
    font-weight: 700;
}


.gauge-labels {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: -10px auto 0;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
}
.gauge-footer {
    text-align: center;
    margin-top: 8px;
    width: 100%;
}

.gauge-footer strong {
    display: block;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    color: #222;
}

.gauge-footer span {
    font-size: 14px;
    color: #666;
}
.add-meal-card h3 {
    text-align: center;
    margin-bottom: 16px;
}

.meal-types {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.meal-types button {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
    background: #f7f7f7;
    font-weight: 600;
}

.meal-types button.active {
    background: #4caf50;
    color: #fff;
    border-color: #4caf50;
}

.food-item {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.food-item select,
.food-item input {
    flex: 1;
}

.remove-food {
    background: #f44336;
    color: #fff;
    border-radius: 8px;
    border: none;
    padding: 0 10px;
}

.btn-outline {
    width: 100%;
    margin-top: 10px;
    background: transparent;
    border: 1px dashed #4caf50;
    color: #4caf50;
    padding: 10px;
    border-radius: 10px;
}

.btn-primary {
    width: 100%;
    margin-top: 16px;
    background: #4caf50;
    color: #fff;
    padding: 14px;
    border-radius: 14px;
    font-size: 16px;
}
/* ===== ADD MEAL CARD ===== */
.add-meal {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Card interno */
.app-card-inner {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

/* ===== CAMPOS ===== */
.app-field label,
.app-card-inner label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.add-meal input,
.add-meal select {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    background: #fff;
}

/* ===== AUTOCOMPLETE ===== */
#food-search {
    border: 2px solid #10b981;
    padding: 14px;
    border-radius: 14px;
    font-size: 15px;
}

#food-autocomplete {
    position: absolute;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    max-height: 260px;
    overflow-y: auto;
    z-index: 9999;
}
#food-autocomplete .autocomplete-item {
    padding: 16px;
    margin-bottom: 8px;
    background: rgba(16,185,129,.08);
    border-radius: 12px;
    cursor: pointer;
}

#food-autocomplete .autocomplete-item:hover {
    background: rgba(16,185,129,.18);
}



/* ===== BOTÕES ===== */
.btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary:hover {
    opacity: 0.95;
}

.btn-secondary {
    background: #ecfdf5;
    color: #047857;
    border: 1px dashed #10b981;
    padding: 12px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #d1fae5;
}

/* ===== FOTO ===== */
.add-meal input[type="file"] {
    padding: 10px;
    border: 2px dashed #10b981;
    background: #ecfdf5;
    cursor: pointer;
}

.add-meal small {
    font-size: 12px;
    color: #6b7280;
}

/* ===== MOBILE ===== */
@media (max-width: 480px) {
    .food-autocomplete {
        max-height: 180px;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}
.meal-photo img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 4px;
}
.meal-photo-group {
    margin-bottom: 10px;
    display: flex;
    justify-content: flex-start;
}

.meal-photo-group img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
/* =========================
   TOTAL DE CALORIAS POR REFEIÇÃO
========================= */

.cal-title-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meal-total-calories {
    font-size: 14px;
    font-weight: 600;
    color: #4caf50; /* verde app */
}
/* espaçamento geral */
.field-group {
    margin-bottom: 18px;
}

/* botão adicionar */

#add-food-btn {
    margin-top: 20px;
    margin-bottom: 28px;
    padding: 14px 18px;
    font-size: 16px;
    border-radius: 14px;
}



/* lista de alimentos */

.foods-added-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.meal-food-card {
    background: #f9fafb;
    padding: 16px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,.06);
}

.meal-food-card small {
    color: #555;
}

#meal_photo {
    opacity: 0;
    position: absolute;
}

.photo-upload-btn {
    display: block;
    padding: 14px;
    background: #0d6efd;
    color: #fff;
    text-align: center;
    border-radius: 12px;
    cursor: pointer;
}
/* Correção Safe Area iOS (notch / dynamic island) */
.profile-header {
    padding-top: calc(16px + env(safe-area-inset-top));
}
body {
    padding-top: env(safe-area-inset-top);
}
.cal-title-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meal-total-kcal {
    font-weight: 700;
    font-size: 14px;
    color: #222;
}

.meal-macros {
    display: flex;
    gap: 12px;
    margin: 6px 0 10px;
    font-size: 13px;
    color: #555;
}

.meal-macros span {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 10px;
}

/* Item individual */
.meal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.meal-item:last-child {
    border-bottom: none;
}

/* Calorias do item */
.meal-calories {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}
/* Card do alimento dentro da refeição */
.meal-food-card {
    background: #fafafa;
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* Conteúdo principal */
.meal-food-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Nome + quantidade */
.meal-food-main .meal-info strong {
    font-size: 14px;
    color: #222;
}

.meal-food-main .meal-info small {
    display: block;
    font-size: 12px;
    color: #666;
}

/* Calorias */
.meal-food-main .meal-calories {
    font-weight: 700;
    font-size: 13px;
    color: #111;
    white-space: nowrap;
}

/* Botão excluir */
.meal-delete {
    margin-left: 10px;
    color: #e53935;
    font-size: 26px;
    text-decoration: none;
    font-weight: bold;
}
.cal-card {
    padding-bottom: 14px;
}

.cal-card .meal-food-card:last-child {
    margin-bottom: 0;
}
body.app-mode {
    margin: 0;
    background: #f4f6f8;
}

body.app-mode #wpadminbar {
    display: none !important;
}
/* CARD DE CONFIRMAÇÃO (barcode) */
.confirm-card {
    background: #f9fafb;
    border: 2px dashed #22c55e;
    border-radius: 14px;
    padding: 14px;
    margin-top: 12px;
    animation: fadeInUp 0.25s ease-out;
}

/* Título */
.confirm-card strong {
    font-size: 15px;
    color: #111827;
}

/* Subtexto */
.confirm-card small {
    color: #6b7280;
    font-size: 13px;
}

/* Input quantidade */
.confirm-card input.confirm-qty {
    border-radius: 10px;
    border: 1px solid #d1d5db;
    padding: 10px;
    font-size: 15px;
}

/* Botões rápidos */
.confirm-card .btn-small {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 999px;
    background: #e5e7eb;
    border: none;
    cursor: pointer;
}

.confirm-card .btn-small:hover {
    background: #22c55e;
    color: #fff;
}

/* Botões finais */
.confirm-card .btn-confirm {
    flex: 1;
    background: #22c55e;
    color: #fff;
    border-radius: 10px;
    padding: 10px;
    border: none;
    font-weight: 600;
}

.confirm-card .btn-cancel {
    flex: 1;
    background: #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    border: none;
}

/* Animação leve */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.peso-down {
    background: #ecfdf5;
    color: #065f46;
}

.peso-up {
    background: #fef2f2;
    color: #7f1d1d;
}

.peso-stable {
    background: #f3f4f6;
    color: #374151;
}
/* HERO LOGIN */
.app-hero {
    min-height: 100vh;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.app-hero-content {
    width: 100%;
    max-width: 380px;
    text-align: center;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    padding: 28px;
    border-radius: 20px;
}

.app-hero h1 {
    color: #fff;
    font-size: 32px;
    margin-bottom: 8px;
}

.app-hero p {
    color: #eaffea;
    font-size: 15px;
    margin-bottom: 24px;
}

.btn-full {
    width: 100%;
    margin-bottom: 10px;
}

.btn-secondary {
    background: #3b82f6;
}

.btn-install {
    background: #111;
}

.ios-install {
    margin-top: 16px;
    background: #fff;
    color: #111;
    padding: 12px;
    border-radius: 12px;
    font-size: 13px;
    text-align: left;
}
