.nbc-app {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* HEADER */
.nbc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}
.nbc-header h2 { margin: 0; font-size: 24px; color: #1a1a1a; }

.nbc-date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 6px 10px;
}
.nbc-date-arrow {
    color: #2e7d32;
    text-decoration: none;
    font-size: 18px;
    padding: 4px 10px;
    border-radius: 6px;
    line-height: 1;
}
.nbc-date-arrow:hover { background: #f1f8e9; }
.nbc-date-form { position: relative; }
.nbc-date-form input[type=date] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.nbc-date-label {
    display: block;
    padding: 6px 10px;
    font-weight: 600;
    color: #1a1a1a;
    min-width: 130px;
    text-align: center;
    cursor: pointer;
}
.nbc-today {
    background: #2e7d32;
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    margin-left: 6px;
}

/* RESUMEN */
.nbc-resumen {
    background: linear-gradient(135deg, #f1f8e9 0%, #fff 100%);
    border: 1px solid #c8e6c9;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 24px;
}
.nbc-resumen-kcal { text-align: center; margin-bottom: 16px; }
.nbc-resumen-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nbc-resumen-valor {
    font-size: 40px;
    font-weight: 800;
    color: #1b5e20;
    line-height: 1;
    margin-top: 4px;
}
.nbc-resumen-valor span {
    font-size: 18px;
    color: #666;
    font-weight: 600;
}
.nbc-macros-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.nbc-macro-item {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    border: 1px solid #e8e8e8;
}
.nbc-macro-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}
.nbc-macro-valor { font-size: 20px; font-weight: 700; color: #1a1a1a; }
.nbc-macro-p .nbc-macro-valor { color: #c62828; }
.nbc-macro-c .nbc-macro-valor { color: #1565c0; }
.nbc-macro-g .nbc-macro-valor { color: #f57f17; }

/* MOMENTO */
.nbc-momento {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
}
.nbc-momento-activo {
    border-color: #2e7d32;
    box-shadow: 0 2px 12px rgba(46,125,50,0.1);
}
.nbc-momento-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.nbc-momento-titulo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    letter-spacing: 0.5px;
}
.nbc-momento-icon { font-size: 18px; }
.nbc-momento-total {
    font-weight: 700;
    color: #2e7d32;
    font-size: 15px;
}

/* ITEMS */
.nbc-items { margin: 12px 0; }
.nbc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #fafafa;
    border-radius: 8px;
    margin-bottom: 6px;
    gap: 10px;
}
.nbc-item-body { flex: 1; min-width: 0; }
.nbc-item-nombre {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
    margin-bottom: 2px;
}
.nbc-item-meta { font-size: 12px; color: #666; }
.nbc-del-form { margin: 0; }
.nbc-item-del {
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 10px;
    line-height: 1;
    border-radius: 6px;
}
.nbc-item-del:hover { color: #c62828; background: #ffebee; }

/* AGREGAR BOTÓN */
.nbc-btn-add {
    display: block;
    text-align: center;
    padding: 10px;
    background: #f1f8e9;
    color: #2e7d32;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    border: 1px dashed #a5d6a7;
    margin-top: 8px;
}
.nbc-btn-add:hover { background: #dcedc8; }

/* FORM DE AGREGAR */
.nbc-add-form { margin-top: 14px; }
.nbc-search-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.nbc-search-form input[type=text] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    min-width: 200px;
}
.nbc-search-form input[type=text]:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
}
.nbc-btn-primary {
    background: #2e7d32;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
}
.nbc-btn-primary:hover { background: #1b5e20; }
.nbc-cancel {
    color: #888;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 10px;
}
.nbc-cancel:hover { color: #c62828; }

/* RESULTADOS DE BÚSQUEDA */
.nbc-search-empty {
    color: #888;
    text-align: center;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
}
.nbc-search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}
.nbc-result {
    display: block;
    padding: 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
}
.nbc-result:hover {
    border-color: #2e7d32;
    background: #f1f8e9;
}
.nbc-result-nombre {
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
    margin-bottom: 4px;
}
.nbc-result-kcal { font-size: 12px; color: #e65100; font-weight: 600; }

/* ALIMENTO SELECCIONADO (paso 3) */
.nbc-add-selected {
    background: #f1f8e9;
    border-radius: 10px;
    padding: 16px;
}
.nbc-selected-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 10px;
}
.nbc-selected-nombre { font-size: 16px; font-weight: 700; color: #1b5e20; }
.nbc-selected-macros {
    font-size: 12px;
    color: #555;
    margin-top: 4px;
}
.nbc-por-100 { color: #888; margin-left: 4px; }
.nbc-back-btn {
    color: #666;
    text-decoration: none;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
}
.nbc-back-btn:hover { background: #fff; }

.nbc-cant-form label {
    display: block;
    font-size: 13px;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
}
.nbc-cant-row {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 8px;
    align-items: center;
}
.nbc-cant-row input[type=number],
.nbc-cant-row select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}
.nbc-cant-row input[type=number]:focus,
.nbc-cant-row select:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
}

/* RESPONSIVE */
@media (max-width: 700px) {
    .nbc-header { flex-direction: column; align-items: stretch; }
    .nbc-date-nav { justify-content: center; }
    .nbc-macros-row { grid-template-columns: 1fr; }
    .nbc-cant-row { grid-template-columns: 1fr; }
    .nbc-search-results { grid-template-columns: 1fr; }
}
